diff options
-rw-r--r-- | libbb/make_directory.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/libbb/make_directory.c b/libbb/make_directory.c index 4486eb1ed..6dd04cf99 100644 --- a/libbb/make_directory.c +++ b/libbb/make_directory.c | |||
@@ -86,7 +86,7 @@ int FAST_FUNC bb_make_directory(char *path, long mode, int flags) | |||
86 | if (mkdir(path, 0777) < 0) { | 86 | if (mkdir(path, 0777) < 0) { |
87 | /* If we failed for any other reason than the directory | 87 | /* If we failed for any other reason than the directory |
88 | * already exists, output a diagnostic and return -1 */ | 88 | * already exists, output a diagnostic and return -1 */ |
89 | if (errno != EEXIST | 89 | if ((errno != EEXIST && errno != EISDIR) |
90 | || !(flags & FILEUTILS_RECUR) | 90 | || !(flags & FILEUTILS_RECUR) |
91 | || ((stat(path, &st) < 0) || !S_ISDIR(st.st_mode)) | 91 | || ((stat(path, &st) < 0) || !S_ISDIR(st.st_mode)) |
92 | ) { | 92 | ) { |