mkdir: fix -p on FreeBSD
authorJeremie Koenig <jk@jk.fr.eu.org>
Thu, 27 May 2010 13:46:33 +0000 (15:46 +0200)
committerDenys Vlasenko <vda.linux@googlemail.com>
Sun, 18 Jul 2010 22:46:28 +0000 (00:46 +0200)
This patch is libbb.make_directory.diff from Debian kFreeBSD at:
http://svn.debian.org/viewsvn/d-i/people/slackydeb/kfreebsd/busybox/1.14/debian

Signed-off-by: Jeremie Koenig <jk@jk.fr.eu.org>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
libbb/make_directory.c

index 4486eb1edf9476014980592080619806327af8b6..6dd04cf999026d15ecb1286fc0d55750ddead414 100644 (file)
@@ -86,7 +86,7 @@ int FAST_FUNC bb_make_directory(char *path, long mode, int flags)
                if (mkdir(path, 0777) < 0) {
                        /* If we failed for any other reason than the directory
                         * already exists, output a diagnostic and return -1 */
-                       if (errno != EEXIST
+                       if ((errno != EEXIST && errno != EISDIR)
                         || !(flags & FILEUTILS_RECUR)
                         || ((stat(path, &st) < 0) || !S_ISDIR(st.st_mode))
                        ) {