[Cmake-commits] CMake branch, next, updated. v3.0.0-rc4-3151-gd35a361

Brad King brad.king at kitware.com
Tue May 13 14:52:46 EDT 2014


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "CMake".

The branch, next has been updated
       via  d35a361f384698c8e44061758fd6e8678b71c90b (commit)
       via  a7e0cb1f0b0bf13549368358a50ee8f396c99dcd (commit)
      from  1a7dac34b5518d44794809156a306b91a7f50f22 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=d35a361f384698c8e44061758fd6e8678b71c90b
commit d35a361f384698c8e44061758fd6e8678b71c90b
Merge: 1a7dac3 a7e0cb1
Author:     Brad King <brad.king at kitware.com>
AuthorDate: Tue May 13 14:52:45 2014 -0400
Commit:     CMake Topic Stage <kwrobot at kitware.com>
CommitDate: Tue May 13 14:52:45 2014 -0400

    Merge topic 'fix-atomic-rename-Windows-sharing-violation' into next
    
    a7e0cb1f cmSystemTools::RenameFile: Retry on Windows ERROR_SHARING_VIOLATION


http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=a7e0cb1f0b0bf13549368358a50ee8f396c99dcd
commit a7e0cb1f0b0bf13549368358a50ee8f396c99dcd
Author:     Eric Berge <ericmberge at gmail.com>
AuthorDate: Tue May 13 09:10:38 2014 -0500
Commit:     Brad King <brad.king at kitware.com>
CommitDate: Tue May 13 14:44:33 2014 -0400

    cmSystemTools::RenameFile: Retry on Windows ERROR_SHARING_VIOLATION
    
    Add ERROR_SHARING_VIOLATION to the set of errors (previosly including
    only ERROR_ACCESS_DENIED) to the errors 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.

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;
       }

-----------------------------------------------------------------------

Summary of changes:
 Source/cmSystemTools.cxx |    6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)


hooks/post-receive
-- 
CMake


More information about the Cmake-commits mailing list