Skip to content

Commit 62d02f3

Browse files
committed
Fix race-under-concurrency in PathNameCreateTemporaryDir.
Thomas Munro Discussion: http://postgr.es/m/CAEepm=1Vp1e3KtftLtw4B60ZV9teNeKu6HxoaaBptQMsRWjJbQ@mail.gmail.com
1 parent 7a727c1 commit 62d02f3

File tree

1 file changed

+1
-1
lines changed
  • src/backend/storage/file

1 file changed

+1
-1
lines changed

src/backend/storage/file/fd.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1451,7 +1451,7 @@ PathNameCreateTemporaryDir(const char *basedir, const char *directory)
14511451
basedir)));
14521452

14531453
/* Try again. */
1454-
if (mkdir(directory, S_IRWXU) < 0)
1454+
if (mkdir(directory, S_IRWXU) < 0 && errno != EEXIST)
14551455
ereport(ERROR,
14561456
(errcode_for_file_access(),
14571457
errmsg("cannot create temporary subdirectory \"%s\": %m",

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy