summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2014-05-13 15:25:47 -0400
committerBrad King <brad.king@kitware.com>2014-05-13 15:25:47 -0400
commit5527cfa002f50a644bf6bbb6a1a7af534870df35 (patch)
tree87c53215ae61a6e2411784d4c84c46cf9b47ebdc
parentb3ebb8f4344d4a3665d7be45a34773fecb94c67f (diff)
parent24bd7ae11af5dc989e569fee8422018a92c4f23e (diff)
downloadcmake-5527cfa002f50a644bf6bbb6a1a7af534870df35.tar.gz
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 ff05975636..c7acfd09bc 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;
}