diff options
author | svn2git <svn2git@FreeBSD.org> | 1994-07-01 08:00:00 +0000 |
---|---|---|
committer | svn2git <svn2git@FreeBSD.org> | 1994-07-01 08:00:00 +0000 |
commit | 5e0e9b99dc3fc0ecd49d929db0d57c784b66f481 (patch) | |
tree | e779b5a6edddbb949b7990751b12d6f25304ba86 /gnu/libexec/uucp/libunix/mkdirs.c | |
parent | a16f65c7d117419bd266c28a1901ef129a337569 (diff) |
Diffstat (limited to 'gnu/libexec/uucp/libunix/mkdirs.c')
-rw-r--r-- | gnu/libexec/uucp/libunix/mkdirs.c | 20 |
1 files changed, 11 insertions, 9 deletions
diff --git a/gnu/libexec/uucp/libunix/mkdirs.c b/gnu/libexec/uucp/libunix/mkdirs.c index a4e0b67bb8c3..9b5b23ffd7b1 100644 --- a/gnu/libexec/uucp/libunix/mkdirs.c +++ b/gnu/libexec/uucp/libunix/mkdirs.c @@ -29,17 +29,19 @@ fsysdep_make_dirs (zfile, fpublic) if (*z == '/' && z != zcopy) { *z = '\0'; - if (! fsysdep_directory (zcopy)) + if (mkdir (zcopy, imode) != 0 + && errno != EEXIST + && (errno != EACCES || ! fsysdep_directory (zcopy))) { - if (mkdir (zcopy, imode) != 0) - { - ulog (LOG_ERROR, "mkdir (%s): %s", zcopy, - strerror (errno)); - ubuffree (zcopy); - return FALSE; - } + ulog (LOG_ERROR, "mkdir (%s): %s", zcopy, + strerror (errno)); + ubuffree (zcopy); + return FALSE; } - *z = '/'; + *z = '/'; /* replace '/' in its place */ + /* now skips over multiple '/' in name */ + while ( (*(z + 1)) && (*(z + 1)) == '/') + z++; } } |