try `rm -rf ~/GNUstep/.AppInfo; mkdir ~/GNUstep/.AppInfo' before and 
after.

>From 66984a30d491a90fdcf27fdf2627f22a8997051e Mon Sep 17 00:00:00 2001
From: Tamas TEVESZ <[email protected]>
Date: Tue, 16 Mar 2010 03:22:52 +0100
Subject: [PATCH] fix WMMkDirHier

if a path component already exists and is a directory (that is, some
work has already been done for us), don't fail.
---
 WINGs/proplist.c |    6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/WINGs/proplist.c b/WINGs/proplist.c
index a6cfb2f..916b2e8 100644
--- a/WINGs/proplist.c
+++ b/WINGs/proplist.c
@@ -1,4 +1,5 @@
 
+#include <errno.h>
 #include <string.h>
 #include <stdarg.h>
 #include <stdio.h>
@@ -1678,8 +1679,9 @@ static int WMMkDirHier(char *path)
                        ;
 
                strncpy(buf, thePath, p);
-               if (mkdir(buf, 0777) == -1) {
-                       wsyserror(_("Could not create %s"), buf);
+               if (mkdir(buf, 0777) == -1 && errno == EEXIST &&
+                   stat(buf, &st) == 0 && !S_ISDIR(st.st_mode)) {
+                       wsyserror(_("Could not create component %s: "), buf);
                        wfree(thePath);
                        return 0;
                }
-- 
1.7.0


-- 
[-]

mkdir /nonexistent
From 66984a30d491a90fdcf27fdf2627f22a8997051e Mon Sep 17 00:00:00 2001
From: Tamas TEVESZ <[email protected]>
Date: Tue, 16 Mar 2010 03:22:52 +0100
Subject: [PATCH] fix WMMkDirHier

if a path component already exists and is a directory (that is, some
work has already been done for us), don't fail.
---
 WINGs/proplist.c |    6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/WINGs/proplist.c b/WINGs/proplist.c
index a6cfb2f..916b2e8 100644
--- a/WINGs/proplist.c
+++ b/WINGs/proplist.c
@@ -1,4 +1,5 @@
 
+#include <errno.h>
 #include <string.h>
 #include <stdarg.h>
 #include <stdio.h>
@@ -1678,8 +1679,9 @@ static int WMMkDirHier(char *path)
 			;
 
 		strncpy(buf, thePath, p);
-		if (mkdir(buf, 0777) == -1) {
-			wsyserror(_("Could not create %s"), buf);
+		if (mkdir(buf, 0777) == -1 && errno == EEXIST &&
+		    stat(buf, &st) == 0 && !S_ISDIR(st.st_mode)) {
+			wsyserror(_("Could not create component %s: "), buf);
 			wfree(thePath);
 			return 0;
 		}
-- 
1.7.0

Reply via email to