fc5bf7fa70cd1dd82764fea6996803b8ee135909
[external/busybox.git] / debian / patches / mkdir-fix-p-on-FreeBSD.patch
1 From 84b01d5afc8230c79a1b8469c222d940c0d4e792 Mon Sep 17 00:00:00 2001
2 From: Jeremie Koenig <jk@jk.fr.eu.org>
3 Date: Thu, 27 May 2010 15:46:33 +0200
4 Subject: [PATCH 7/9] mkdir: fix -p on FreeBSD
5
6 This patch is libbb.make_directory.diff from Debian kFreeBSD at:
7 http://svn.debian.org/viewsvn/d-i/people/slackydeb/kfreebsd/busybox/1.14/debian
8
9 Signed-off-by: Jeremie Koenig <jk@jk.fr.eu.org>
10 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
11 ---
12  libbb/make_directory.c |    2 +-
13  1 files changed, 1 insertions(+), 1 deletions(-)
14
15 diff --git a/libbb/make_directory.c b/libbb/make_directory.c
16 index 4486eb1..6dd04cf 100644
17 --- a/libbb/make_directory.c
18 +++ b/libbb/make_directory.c
19 @@ -86,7 +86,7 @@ int FAST_FUNC bb_make_directory(char *path, long mode, int flags)
20                 if (mkdir(path, 0777) < 0) {
21                         /* If we failed for any other reason than the directory
22                          * already exists, output a diagnostic and return -1 */
23 -                       if (errno != EEXIST
24 +                       if ((errno != EEXIST && errno != EISDIR)
25                          || !(flags & FILEUTILS_RECUR)
26                          || ((stat(path, &st) < 0) || !S_ISDIR(st.st_mode))
27                         ) {
28 -- 
29 1.7.1
30