From: Jeremie Koenig Date: Thu, 27 May 2010 13:46:33 +0000 (+0200) Subject: mkdir: fix -p on FreeBSD X-Git-Tag: 1_18_0~401 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=84b01d5afc8230c79a1b8469c222d940c0d4e792;p=oweals%2Fbusybox.git mkdir: fix -p on FreeBSD 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 Signed-off-by: Denys Vlasenko --- 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) 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)) ) {