summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorDouglas Gregor <dgregor@apple.com>2013-04-05 20:48:36 +0000
committerDouglas Gregor <dgregor@apple.com>2013-04-05 20:48:36 +0000
commit0591f19c8b84311288ef19f76952c334b9730681 (patch)
treec6671f512dc7277e51ef513378292f3e2b7644b5 /lib
parentc0a74e28cf937f0e847b1bb907c396411e2aac36 (diff)
downloadllvm-0591f19c8b84311288ef19f76952c334b9730681.tar.gz
llvm-0591f19c8b84311288ef19f76952c334b9730681.tar.bz2
llvm-0591f19c8b84311288ef19f76952c334b9730681.tar.xz
<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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@178908 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib')
-rw-r--r--lib/Support/Unix/PathV2.inc4
1 files changed, 1 insertions, 3 deletions
diff --git a/lib/Support/Unix/PathV2.inc b/lib/Support/Unix/PathV2.inc
index a3dfd4b0a3..7e0aead151 100644
--- a/lib/Support/Unix/PathV2.inc
+++ b/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;