summaryrefslogtreecommitdiffstats
path: root/llvm
diff options
context:
space:
mode:
authorReid Kleckner <reid@kleckner.net>2015-04-10 17:20:45 +0000
committerReid Kleckner <reid@kleckner.net>2015-04-10 17:20:45 +0000
commitd03f9f4016b90d835e28ccd11b490b81e9428b9d (patch)
treef90907e2315bb564ff13a4a965ffb3f96c745a68 /llvm
parentcc815568314d2231eb755d9626303b8ce614adc6 (diff)
downloadbcm5719-llvm-d03f9f4016b90d835e28ccd11b490b81e9428b9d.tar.gz
bcm5719-llvm-d03f9f4016b90d835e28ccd11b490b81e9428b9d.zip
[FS] Report errors from llvm::sys::fs::rename on Windows
Previously we would always report success, which is pretty bogus. I'm too lazy to write a test where rename will portably fail on all platforms. I'm just trying to fix breakage introduced by r234597, which happened to tickle this. llvm-svn: 234611
Diffstat (limited to 'llvm')
-rw-r--r--llvm/lib/Support/Windows/Path.inc1
1 files changed, 1 insertions, 0 deletions
diff --git a/llvm/lib/Support/Windows/Path.inc b/llvm/lib/Support/Windows/Path.inc
index d558ff5bfae..b5523aaf438 100644
--- a/llvm/lib/Support/Windows/Path.inc
+++ b/llvm/lib/Support/Windows/Path.inc
@@ -261,6 +261,7 @@ std::error_code rename(const Twine &from, const Twine &to) {
MOVEFILE_COPY_ALLOWED | MOVEFILE_REPLACE_EXISTING))
return std::error_code();
DWORD LastError = ::GetLastError();
+ ec = windows_error(LastError);
if (LastError != ERROR_ACCESS_DENIED)
break;
// Retry MoveFile() at ACCESS_DENIED.
OpenPOWER on IntegriCloud