summaryrefslogtreecommitdiffstats
path: root/Source/cmFileCopier.cxx
diff options
context:
space:
mode:
authorSebastian Holtermann <sebholt@xwmw.org>2019-05-22 08:14:46 (GMT)
committerSebastian Holtermann <sebholt@xwmw.org>2019-05-22 08:57:10 (GMT)
commit9c576a88d95b302882bcb0a021dcf03982a40902 (patch)
tree37f7179633b02af9328e5d22574ee8effdf31459 /Source/cmFileCopier.cxx
parent4b45a5d5c7f9266e5ca08f6d5676759b9aac4235 (diff)
downloadCMake-9c576a88d95b302882bcb0a021dcf03982a40902.zip
CMake-9c576a88d95b302882bcb0a021dcf03982a40902.tar.gz
CMake-9c576a88d95b302882bcb0a021dcf03982a40902.tar.bz2
Use cmFileTimes instead of cmSystemToolsFileTime interface
Diffstat (limited to 'Source/cmFileCopier.cxx')
-rw-r--r--Source/cmFileCopier.cxx24
1 files changed, 10 insertions, 14 deletions
diff --git a/Source/cmFileCopier.cxx b/Source/cmFileCopier.cxx
index 972cd6e..49e8cd5 100644
--- a/Source/cmFileCopier.cxx
+++ b/Source/cmFileCopier.cxx
@@ -5,6 +5,7 @@
#include "cmFSPermissions.h"
#include "cmFileCommand.h"
+#include "cmFileTimes.h"
#include "cmMakefile.h"
#include "cmSystemTools.h"
#include "cmsys/Directory.hxx"
@@ -75,20 +76,15 @@ bool cmFileCopier::SetPermissions(const std::string& toFile,
// Writing to an NTFS alternate stream changes the modification
// time, so we need to save and restore its original value.
- cmSystemToolsFileTime* file_time_orig = cmSystemTools::FileTimeNew();
- cmSystemTools::FileTimeGet(toFile, file_time_orig);
-
- cmsys::ofstream permissionStream(mode_t_adt_filename.c_str());
-
- if (permissionStream) {
- permissionStream << std::oct << permissions << std::endl;
+ cmFileTimes file_time_orig(toFile);
+ {
+ cmsys::ofstream permissionStream(mode_t_adt_filename.c_str());
+ if (permissionStream) {
+ permissionStream << std::oct << permissions << std::endl;
+ }
+ permissionStream.close();
}
-
- permissionStream.close();
-
- cmSystemTools::FileTimeSet(toFile, file_time_orig);
-
- cmSystemTools::FileTimeDelete(file_time_orig);
+ file_time_orig.Store(toFile);
}
#endif
@@ -614,7 +610,7 @@ bool cmFileCopier::InstallFile(const std::string& fromFile,
if (cmSystemTools::GetPermissions(toFile, perm)) {
cmSystemTools::SetPermissions(toFile, perm | mode_owner_write);
}
- if (!cmSystemTools::CopyFileTime(fromFile, toFile)) {
+ if (!cmFileTimes::Copy(fromFile, toFile)) {
std::ostringstream e;
e << this->Name << " cannot set modification time on \"" << toFile
<< "\"";