mod_tile: Ignore multiple threads attempting to create the same directory. Fixes ticket 3772.

This commit is contained in:
Jon Burgess
2011-05-18 22:05:08 +00:00
parent 0135427519
commit 1c370cf4a1

View File

@ -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 = '/';
}