diff options
author | Ron Yorston <rmy@pobox.com> | 2018-02-13 09:44:44 +0000 |
---|---|---|
committer | Ron Yorston <rmy@pobox.com> | 2018-02-13 09:44:44 +0000 |
commit | dc19a361bd6c6df30338371532691bbc7f7126bb (patch) | |
tree | 1fb2cd646d54b5f8e425c4f11f3e09fc21d1966b /libbb/make_directory.c | |
parent | 096aee2bb468d1ab044de36e176ed1f6c7e3674d (diff) | |
parent | 3459024bf404af814cacfe90a0deb719e282ae62 (diff) | |
download | busybox-w32-dc19a361bd6c6df30338371532691bbc7f7126bb.tar.gz busybox-w32-dc19a361bd6c6df30338371532691bbc7f7126bb.tar.bz2 busybox-w32-dc19a361bd6c6df30338371532691bbc7f7126bb.zip |
Merge branch 'busybox' into merge
Diffstat (limited to 'libbb/make_directory.c')
-rw-r--r-- | libbb/make_directory.c | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/libbb/make_directory.c b/libbb/make_directory.c index 6422c863f..1f3aecf40 100644 --- a/libbb/make_directory.c +++ b/libbb/make_directory.c | |||
@@ -125,6 +125,7 @@ int FAST_FUNC bb_make_directory(char *path, long mode, int flags) | |||
125 | } | 125 | } |
126 | } | 126 | } |
127 | 127 | ||
128 | //bb_error_msg("mkdir '%s'", path); | ||
128 | if (mkdir(path, 0777) < 0) { | 129 | if (mkdir(path, 0777) < 0) { |
129 | /* If we failed for any other reason than the directory | 130 | /* If we failed for any other reason than the directory |
130 | * already exists, output a diagnostic and return -1 */ | 131 | * already exists, output a diagnostic and return -1 */ |
@@ -151,13 +152,16 @@ int FAST_FUNC bb_make_directory(char *path, long mode, int flags) | |||
151 | /* Done. If necessary, update perms on the newly | 152 | /* Done. If necessary, update perms on the newly |
152 | * created directory. Failure to update here _is_ | 153 | * created directory. Failure to update here _is_ |
153 | * an error. */ | 154 | * an error. */ |
154 | if ((mode != -1) && (chmod(path, mode) < 0)) { | 155 | if (mode != -1) { |
155 | fail_msg = "set permissions of"; | 156 | //bb_error_msg("chmod 0%03lo mkdir '%s'", mode, path); |
156 | if (flags & FILEUTILS_IGNORE_CHMOD_ERR) { | 157 | if (chmod(path, mode) < 0) { |
157 | flags = 0; | 158 | fail_msg = "set permissions of"; |
158 | goto print_err; | 159 | if (flags & FILEUTILS_IGNORE_CHMOD_ERR) { |
160 | flags = 0; | ||
161 | goto print_err; | ||
162 | } | ||
163 | break; | ||
159 | } | 164 | } |
160 | break; | ||
161 | } | 165 | } |
162 | goto ret0; | 166 | goto ret0; |
163 | } | 167 | } |