aboutsummaryrefslogtreecommitdiff
path: root/libbb/make_directory.c
diff options
context:
space:
mode:
Diffstat (limited to 'libbb/make_directory.c')
-rw-r--r--libbb/make_directory.c16
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 }