diff options
author | Brad King <brad.king@kitware.com> | 2014-05-14 17:58:33 (GMT) |
---|---|---|
committer | CMake Topic Stage <kwrobot@kitware.com> | 2014-05-14 17:58:33 (GMT) |
commit | 775458dede98d28fe81ac878541a6ead735443fc (patch) | |
tree | 25f93566dc922866bd67568301f23377c60bb980 /Source/cmSystemTools.cxx | |
parent | 07163ca0701485785372c07d53c76dc7f52765b1 (diff) | |
parent | 24bd7ae11af5dc989e569fee8422018a92c4f23e (diff) | |
download | CMake-775458dede98d28fe81ac878541a6ead735443fc.zip CMake-775458dede98d28fe81ac878541a6ead735443fc.tar.gz CMake-775458dede98d28fe81ac878541a6ead735443fc.tar.bz2 |
Merge topic 'fix-atomic-rename-Windows-sharing-violation'
24bd7ae1 cmSystemTools::RenameFile: Retry on Windows ERROR_SHARING_VIOLATION
Diffstat (limited to 'Source/cmSystemTools.cxx')
-rw-r--r-- | Source/cmSystemTools.cxx | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/Source/cmSystemTools.cxx b/Source/cmSystemTools.cxx index c27b561..c38a99c 100644 --- a/Source/cmSystemTools.cxx +++ b/Source/cmSystemTools.cxx @@ -886,8 +886,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; } |