mirror of
https://github.com/postgres/postgres.git
synced 2026-06-09 08:42:38 -04:00
Fix race-under-concurrency in PathNameCreateTemporaryDir.
Thomas Munro Discussion: http://postgr.es/m/CAEepm=1Vp1e3KtftLtw4B60ZV9teNeKu6HxoaaBptQMsRWjJbQ@mail.gmail.com
This commit is contained in:
parent
7a727c180a
commit
62d02f39e7
1 changed files with 1 additions and 1 deletions
|
|
@ -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",
|
||||
|
|
|
|||
Loading…
Reference in a new issue