summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Support/Signals.cpp
diff options
context:
space:
mode:
authorGreg Bedwell <greg_bedwell@sn.scee.net>2015-10-12 15:11:47 +0000
committerGreg Bedwell <greg_bedwell@sn.scee.net>2015-10-12 15:11:47 +0000
commit7f68a7166925b4d5e1a4c5a8eea5f6689352b89d (patch)
tree48d8bcebe721af95c5f7ec7ad713c774e53e014f /llvm/lib/Support/Signals.cpp
parent3b732ac7eeeab398211beae85e134523d514718e (diff)
downloadbcm5719-llvm-7f68a7166925b4d5e1a4c5a8eea5f6689352b89d.tar.gz
bcm5719-llvm-7f68a7166925b4d5e1a4c5a8eea5f6689352b89d.zip
Fix rename() sometimes failing if another process uses openFileForRead()
On Windows, fs::rename() could fail is another process was reading the file at the same time using fs::openFileForRead(). In most cases the user wouldn't notice as fs::rename() will continue to retry for 2000ms. Typically this is enough for the read to complete and a retry to succeed, but if the disk is being it too hard then the response time might be longer than the retry time and the rename would fail with a permission error. Add FILE_SHARE_DELETE to the sharing flags for CreateFileW() in fs::openFileForRead() and try ReplaceFileW() prior to MoveFileExW() in fs::rename(). Based on an initial patch by Edd Dawson! Differential Revision: http://reviews.llvm.org/D13647 llvm-svn: 250046
Diffstat (limited to 'llvm/lib/Support/Signals.cpp')
0 files changed, 0 insertions, 0 deletions
OpenPOWER on IntegriCloud