Permalink
Browse files

mod_tile: Ignore multiple threads attempting to create the same direc…

…tory. Fixes ticket 3772.

git-svn-id: http://svn.openstreetmap.org/applications/utils/mod_tile@26008 b9d5c4c9-76e1-0310-9c85-f3177eceb1e4
  • Loading branch information...
1 parent 5946d52 commit 599cf20ab12e312e63a41954d0960cd1124c73d9 jonb committed May 18, 2011
Showing with 6 additions and 3 deletions.
  1. +6 −3 dir_utils.c
View
@@ -5,7 +5,7 @@
#include <string.h>
#include <sys/types.h>
#include <sys/stat.h>
-
+#include <errno.h>
#include "protocol.h"
#include "render_config.h"
@@ -45,8 +45,11 @@ int mkdirp(const char *path) {
return 1;
}
} else if (mkdir(tmp, 0777)) {
- perror(tmp);
- return 1;
+ // Ignore multiple threads attempting to create the same directory
+ if (errno != EEXIST) {
+ perror(tmp);
+ return 1;
+ }
}
*p = '/';
}

0 comments on commit 599cf20

Please sign in to comment.