projects
/
platform
/
upstream
/
llvm.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
7f90387
)
[Support][Windows] Prevent 2s delay when renaming a file that does not exist
author
Ben Dunbobbin
<Ben.Dunbobbin@sony.com>
Wed, 1 Jul 2020 16:49:30 +0000
(17:49 +0100)
committer
Ben Dunbobbin
<Ben.Dunbobbin@sony.com>
Thu, 2 Jul 2020 09:41:17 +0000
(10:41 +0100)
Differential Revision: https://reviews.llvm.org/D82542
llvm/lib/Support/Windows/Path.inc
patch
|
blob
|
history
diff --git
a/llvm/lib/Support/Windows/Path.inc
b/llvm/lib/Support/Windows/Path.inc
index
ec62e65
..
96677e2
100644
(file)
--- a/
llvm/lib/Support/Windows/Path.inc
+++ b/
llvm/lib/Support/Windows/Path.inc
@@
-555,6
+555,11
@@
std::error_code rename(const Twine &From, const Twine &To) {
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());