Commit 5527cfa0 authored by Brad King's avatar Brad King
Browse files

Merge branch 'fix-atomic-rename-Windows-sharing-violation' into release

parents b3ebb8f4 24bd7ae1
......@@ -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;
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment