cmSystemTools: Revert use of MOVEFILE_WRITE_THROUGH by RenameFile on Windows

Revert commit d78c22aa64 (cmSystemTools: Improve RenameFile on Windows
with MOVEFILE_WRITE_THROUGH, 2020-08-25, v3.19.0-rc1~243^2~3).  Using
this flag causes the operation to fail frequently in some environments.
Drop it for now pending further investigation.

Fixes: #21571
This commit is contained in:
Brad King
2020-12-16 15:24:02 -05:00
parent 0932b1c2b2
commit 92021198e5

View File

@@ -952,9 +952,8 @@ bool cmMoveFile(std::wstring const& oldname, std::wstring const& newname)
SetLastError(0);
// 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_WRITE_THROUGH);
MOVEFILE_REPLACE_EXISTING);
}
}
#endif