From 32b76b3576f1516e5f422dc3f43389aaa00465c9 Mon Sep 17 00:00:00 2001 From: Bill Currie Date: Wed, 20 Feb 2013 14:03:03 +0900 Subject: [PATCH] Do not try to create directories that already exist. It seem that solaris will return EACCESS instead of EEXIST if the user doesn't have write permission in the parent directory. --- libs/util/sys.c | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/libs/util/sys.c b/libs/util/sys.c index bd9e12df4..0eaec004a 100644 --- a/libs/util/sys.c +++ b/libs/util/sys.c @@ -199,9 +199,7 @@ Sys_mkdir (const char *path) # error do not know how to make directories # endif #endif - if (errno != EEXIST) - return -1; - return 0; + return -1; } VISIBLE int @@ -869,10 +867,13 @@ Sys_CreatePath (const char *path) strcpy (e_path, path); for (ofs = e_path + 1; *ofs; ofs++) { - if (*ofs == '/') { // create the directory + if (*ofs == '/') { *ofs = 0; - if (Sys_mkdir (e_path) == -1) - return -1; + if (!Sys_isdir (e_path)) { + // create the directory + if (Sys_mkdir (e_path) == -1) + return -1; + } *ofs = '/'; } }