summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2014-05-13 19:25:47 (GMT)
committerBrad King <brad.king@kitware.com>2014-05-13 19:25:47 (GMT)
commit5527cfa002f50a644bf6bbb6a1a7af534870df35 (patch)
tree87c53215ae61a6e2411784d4c84c46cf9b47ebdc
parentb3ebb8f4344d4a3665d7be45a34773fecb94c67f (diff)
parent24bd7ae11af5dc989e569fee8422018a92c4f23e (diff)
downloadCMake-5527cfa002f50a644bf6bbb6a1a7af534870df35.zip
CMake-5527cfa002f50a644bf6bbb6a1a7af534870df35.tar.gz
CMake-5527cfa002f50a644bf6bbb6a1a7af534870df35.tar.bz2
Merge branch 'fix-atomic-rename-Windows-sharing-violation' into release
-rw-r--r--Source/cmSystemTools.cxx6
1 files changed, 4 insertions, 2 deletions
diff --git a/Source/cmSystemTools.cxx b/Source/cmSystemTools.cxx
index ff05975..c7acfd0 100644
--- a/Source/cmSystemTools.cxx
+++ b/Source/cmSystemTools.cxx
@@ -917,8 +917,10 @@ bool cmSystemTools::RenameFile(const char* oldname, const char* newname)
cmsys::Encoding::ToWide(newname).c_str(),
MOVEFILE_REPLACE_EXISTING) && --retry.Count)
{
- // Try again only if failure was due to access permissions.
- if(GetLastError() != ERROR_ACCESS_DENIED)
+ DWORD last_error = GetLastError();
+ // Try again only if failure was due to access/sharing permissions.
+ if(last_error != ERROR_ACCESS_DENIED &&
+ last_error != ERROR_SHARING_VIOLATION)
{
return false;
}