git.postgresql.org Git - postgresql.git/commitdiff

git projects / postgresql.git / commitdiff
? search:
summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 7a727c1)
Fix race-under-concurrency in PathNameCreateTemporaryDir.
2017年12月27日 18:56:14 +0000 (10:56 -0800)
2017年12月27日 18:56:14 +0000 (10:56 -0800)
Thomas Munro

Discussion: http://postgr.es/m/CAEepm=1Vp1e3KtftLtw4B60ZV9teNeKu6HxoaaBptQMsRWjJbQ@mail.gmail.com


diff --git a/src/backend/storage/file/fd.c b/src/backend/storage/file/fd.c
index 5c7fd645ac6844589ac323e423add7a36da79a56..f449ee5c51a3114c029d8db6a2470ff904e0179d 100644 (file)
--- 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",
This is the main PostgreSQL git repository.
RSS Atom

AltStyle によって変換されたページ (->オリジナル) /