[cmake-developers] [PATCH] Retry Rename on Windows ERROR_SHARING_VIOLATION

Eric Berge ericmberge at gmail.com
Tue May 13 12:25:31 EDT 2014


Attached is a patch which simply adds ERROR_SHARING_VIOLATION to the set of
errors (currently 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.  Since, in the case observed, both source files were
sharing read, write, and delete and the MoveFileEx calls were using the
"replaceIfExists" flag, you would think that Windows would allow them both
to succeed since either one being the winner is ok.  Arguably a bug (at
least I would argue it's a bug) in Windows.

Eric
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/cmake-developers/attachments/20140513/734f4786/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0003-Retry-rename-on-Windows-ERROR_SHARING_VIOLATION.patch
Type: application/octet-stream
Size: 1068 bytes
Desc: not available
URL: <http://public.kitware.com/pipermail/cmake-developers/attachments/20140513/734f4786/attachment.obj>


More information about the cmake-developers mailing list