From 6d48bd04aac577e9b655494cbd8b0748424ef053 Mon Sep 17 00:00:00 2001 From: Reid Kleckner Date: Fri, 10 Apr 2015 17:20:45 +0000 Subject: [PATCH] [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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@234611 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Support/Windows/Path.inc | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/Support/Windows/Path.inc b/lib/Support/Windows/Path.inc index d558ff5bfae..b5523aaf438 100644 --- a/lib/Support/Windows/Path.inc +++ b/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. -- 2.34.1