diff options
author | Douglas Gregor <dgregor@apple.com> | 2013-04-05 20:48:36 +0000 |
---|---|---|
committer | Douglas Gregor <dgregor@apple.com> | 2013-04-05 20:48:36 +0000 |
commit | 6bd4d8cf72d1bf0fbafe387d86b6d7f057443703 (patch) | |
tree | 0a97c67c75ac374381b804de7d8bb330f4738bb9 /llvm/lib/Support/Unix | |
parent | 005daf1bc6aabef451f92fcbdb46e0c62b866e4d (diff) | |
download | bcm5719-llvm-6bd4d8cf72d1bf0fbafe387d86b6d7f057443703.tar.gz bcm5719-llvm-6bd4d8cf72d1bf0fbafe387d86b6d7f057443703.zip |
<rdar://problem/13551789> Fix yet another race in unique_file.
If the directory that will contain the unique file doesn't exist when
we tried to create the file, but another process creates it before we
get a chance to try creating it, we would bail out rather than try to
create the unique file.
llvm-svn: 178908
Diffstat (limited to 'llvm/lib/Support/Unix')
-rw-r--r-- | llvm/lib/Support/Unix/PathV2.inc | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/llvm/lib/Support/Unix/PathV2.inc b/llvm/lib/Support/Unix/PathV2.inc index a3dfd4b0a32..7e0aead151b 100644 --- a/llvm/lib/Support/Unix/PathV2.inc +++ b/llvm/lib/Support/Unix/PathV2.inc @@ -430,9 +430,7 @@ rety_open_create: if (SavedErrno == errc::file_exists) goto retry_random_path; // If path prefix doesn't exist, try to create it. - if (SavedErrno == errc::no_such_file_or_directory && - !exists(path::parent_path(RandomPath)) && - !TriedToCreateParent) { + if (SavedErrno == errc::no_such_file_or_directory && !TriedToCreateParent) { TriedToCreateParent = true; StringRef p(RandomPath); SmallString<64> dir_to_create; |