summaryrefslogtreecommitdiff
path: root/source3/lib
diff options
context:
space:
mode:
Diffstat (limited to 'source3/lib')
-rw-r--r--source3/lib/util.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/source3/lib/util.c b/source3/lib/util.c
index d21c730f3b..93aab3c2ad 100644
--- a/source3/lib/util.c
+++ b/source3/lib/util.c
@@ -1517,9 +1517,14 @@ static char *xx_path(const char *name, const char *rootpath)
trim_string(fname,"","/");
if (!directory_exist(fname)) {
- if (!mkdir(fname,0755))
- DEBUG(1, ("Unable to create directory %s for file %s. "
- "Error was %s\n", fname, name, strerror(errno)));
+ if (mkdir(fname,0755) == -1) {
+ /* Did someone else win the race ? */
+ if (errno != EEXIST) {
+ DEBUG(1, ("Unable to create directory %s for file %s. "
+ "Error was %s\n", fname, name, strerror(errno)));
+ return NULL;
+ }
+ }
}
return talloc_asprintf_append(fname, "/%s", name);