aboutsummaryrefslogtreecommitdiff
path: root/libbb
diff options
context:
space:
mode:
Diffstat (limited to 'libbb')
-rw-r--r--libbb/make_directory.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/libbb/make_directory.c b/libbb/make_directory.c
index 668fea7ff..1c3026ccc 100644
--- a/libbb/make_directory.c
+++ b/libbb/make_directory.c
@@ -57,8 +57,12 @@ int make_directory (char *path, long mode, int flags)
57 } 57 }
58 } 58 }
59 ret = mkdir(path, mode); 59 ret = mkdir(path, mode);
60 if ( (ret == -1) && (errno != EEXIST) ) { 60 if (ret == -1) {
61 perror_msg("Cannot create directory %s", path); 61 if (errno == EEXIST) {
62 ret = 0;
63 } else {
64 perror_msg("Cannot create directory %s", path);
65 }
62 } 66 }
63 return ret; 67 return(ret);
64} 68}