mirror of
https://github.com/amadvance/snapraid.git
synced 2026-12-04 22:00:19 -05:00
Fixes directory creation.
This commit is contained in:
parent
d6c3b1b326
commit
afd4120622
1 changed files with 7 additions and 7 deletions
14
util.c
14
util.c
|
|
@ -679,13 +679,13 @@ int mkancestor(const char* file)
|
||||||
}
|
}
|
||||||
|
|
||||||
/* try creating it */
|
/* try creating it */
|
||||||
if (mkdir(dir, S_IRWXU | S_IRGRP | S_IXGRP | S_IROTH | S_IXOTH) != 0) {
|
if (mkdir(dir, S_IRWXU | S_IRGRP | S_IXGRP | S_IROTH | S_IXOTH) == 0) {
|
||||||
/* if it already exists, we are done */
|
/* just created */
|
||||||
if (errno == EEXIST) {
|
return 0;
|
||||||
return 0;
|
}
|
||||||
}
|
if (errno == EEXIST) {
|
||||||
fprintf(stderr, "Error creating directory '%s'. %s.\n", dir, strerror(errno));
|
/* it already exists */
|
||||||
return -1;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* recursively create them all */
|
/* recursively create them all */
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue