mirror of
https://github.com/amadvance/snapraid.git
synced 2026-10-26 02:49:02 -04: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 */
|
||||
if (mkdir(dir, S_IRWXU | S_IRGRP | S_IXGRP | S_IROTH | S_IXOTH) != 0) {
|
||||
/* if it already exists, we are done */
|
||||
if (errno == EEXIST) {
|
||||
return 0;
|
||||
}
|
||||
fprintf(stderr, "Error creating directory '%s'. %s.\n", dir, strerror(errno));
|
||||
return -1;
|
||||
if (mkdir(dir, S_IRWXU | S_IRGRP | S_IXGRP | S_IROTH | S_IXOTH) == 0) {
|
||||
/* just created */
|
||||
return 0;
|
||||
}
|
||||
if (errno == EEXIST) {
|
||||
/* it already exists */
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* recursively create them all */
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue