summaryrefslogtreecommitdiffstats
path: root/Source/cmUseMangledMesaCommand.cxx
diff options
context:
space:
mode:
authorRolf Eike Beer <eb@emlix.com>2019-09-09 08:34:08 (GMT)
committerRolf Eike Beer <eb@emlix.com>2019-09-09 08:34:08 (GMT)
commit5b96fd5b81bde4655e471a31bf0fc579c1d10136 (patch)
tree13d9a3b24d84e1d15c4e1929c6c6224ae126675f /Source/cmUseMangledMesaCommand.cxx
parent5eaf1e1be289245267263536f5464e40d2a677c0 (diff)
downloadCMake-5b96fd5b81bde4655e471a31bf0fc579c1d10136.zip
CMake-5b96fd5b81bde4655e471a31bf0fc579c1d10136.tar.gz
CMake-5b96fd5b81bde4655e471a31bf0fc579c1d10136.tar.bz2
use cmSystemTools::MoveFileIfDifferent()
This is better than doing CopyFileIfDifferent() followed by RemoveFile() in two ways: - it is more efficient, as it avoids disk I/O for the data, even if the files here are usually small - it is atomic, so an abort during the copy will not leave a destination file with partial data behind
Diffstat (limited to 'Source/cmUseMangledMesaCommand.cxx')
-rw-r--r--Source/cmUseMangledMesaCommand.cxx3
1 files changed, 1 insertions, 2 deletions
diff --git a/Source/cmUseMangledMesaCommand.cxx b/Source/cmUseMangledMesaCommand.cxx
index cfc00e8..1fd386b 100644
--- a/Source/cmUseMangledMesaCommand.cxx
+++ b/Source/cmUseMangledMesaCommand.cxx
@@ -98,7 +98,6 @@ void CopyAndFullPathMesaHeader(const std::string& source,
// close the files before attempting to copy
fin.close();
fout.close();
- cmSystemTools::CopyFileIfDifferent(tempOutputFile, outFile);
- cmSystemTools::RemoveFile(tempOutputFile);
+ cmSystemTools::MoveFileIfDifferent(tempOutputFile, outFile);
}
}