aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobert Haas <rhaas@postgresql.org>2017-12-27 10:56:14 -0800
committerRobert Haas <rhaas@postgresql.org>2017-12-27 10:56:14 -0800
commit62d02f39e72a2c030711a772f00f47f51262803c (patch)
treeceabf63cf12453e7d21c83ef4bca782120eb7458
parent7a727c180aa3c3baba12957d4cbec7b022ba4be5 (diff)
downloadpostgresql-62d02f39e72a2c030711a772f00f47f51262803c.tar.gz
postgresql-62d02f39e72a2c030711a772f00f47f51262803c.zip
Fix race-under-concurrency in PathNameCreateTemporaryDir.
Thomas Munro Discussion: http://postgr.es/m/CAEepm=1Vp1e3KtftLtw4B60ZV9teNeKu6HxoaaBptQMsRWjJbQ@mail.gmail.com
-rw-r--r--src/backend/storage/file/fd.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/backend/storage/file/fd.c b/src/backend/storage/file/fd.c
index 5c7fd645ac6..f449ee5c51a 100644
--- a/src/backend/storage/file/fd.c
+++ b/src/backend/storage/file/fd.c
@@ -1451,7 +1451,7 @@ PathNameCreateTemporaryDir(const char *basedir, const char *directory)
basedir)));
/* Try again. */
- if (mkdir(directory, S_IRWXU) < 0)
+ if (mkdir(directory, S_IRWXU) < 0 && errno != EEXIST)
ereport(ERROR,
(errcode_for_file_access(),
errmsg("cannot create temporary subdirectory \"%s\": %m",