Commit 24bd7ae1 authored by Eric Berge's avatar Eric Berge Committed by Brad King
Browse files

cmSystemTools::RenameFile: Retry on Windows ERROR_SHARING_VIOLATION

Add ERROR_SHARING_VIOLATION to the set of errors (previously including
only ERROR_ACCESS_DENIED) that cause a rename (MoveFile) on Windows to
retry.  The condition was observed when two renames to the same target
file name were happening simultaneously.
parent 9996b984
......@@ -917,8 +917,10 @@ bool cmSystemTools::RenameFile(const char* oldname, const char* newname)
// 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 &&
return false;
Supports Markdown
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