summaryrefslogtreecommitdiffstats
path: root/Source/cmSystemTools.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'Source/cmSystemTools.cxx')
-rw-r--r--Source/cmSystemTools.cxx4
1 files changed, 3 insertions, 1 deletions
diff --git a/Source/cmSystemTools.cxx b/Source/cmSystemTools.cxx
index b63c318..3cea743 100644
--- a/Source/cmSystemTools.cxx
+++ b/Source/cmSystemTools.cxx
@@ -885,8 +885,10 @@ void cmSystemTools::InitializeLibUV()
namespace {
bool cmMoveFile(std::wstring const& oldname, std::wstring const& newname)
{
+ // Use MOVEFILE_REPLACE_EXISTING to replace an existing destination file.
+ // Use MOVEFILE_WRITE_THROUGH to flush the change to disk before returning.
return MoveFileExW(oldname.c_str(), newname.c_str(),
- MOVEFILE_REPLACE_EXISTING);
+ MOVEFILE_REPLACE_EXISTING | MOVEFILE_WRITE_THROUGH);
}
}
#endif