Skip to content
Snippets Groups Projects
Commit 6bd4d8cf authored by Douglas Gregor's avatar Douglas Gregor
Browse files

<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
parent 005daf1b
No related branches found
No related tags found
No related merge requests found
......@@ -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;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment