[PATCH] D82542: [Support][Windows] Prevent 2s delay when renaming a file that does not exist
ben via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Tue Jun 30 03:46:35 PDT 2020
bd1976llvm updated this revision to Diff 274398.
bd1976llvm added a comment.
Addressed review comments.
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D82542/new/
https://reviews.llvm.org/D82542
Files:
llvm/lib/Support/Windows/Path.inc
Index: llvm/lib/Support/Windows/Path.inc
===================================================================
--- llvm/lib/Support/Windows/Path.inc
+++ llvm/lib/Support/Windows/Path.inc
@@ -555,6 +555,11 @@
NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
if (FromHandle)
break;
+
+ // We don't want to loop if the file doesn't exist.
+ auto EC = mapWindowsError(GetLastError());
+ if (EC == errc::no_such_file_or_directory)
+ return EC;
}
if (!FromHandle)
return mapWindowsError(GetLastError());
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D82542.274398.patch
Type: text/x-patch
Size: 558 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200630/f21ff679/attachment.bin>
More information about the llvm-commits
mailing list