diff options
Diffstat (limited to 'Source/cmSystemTools.cxx')
-rw-r--r-- | Source/cmSystemTools.cxx | 43 |
1 files changed, 2 insertions, 41 deletions
diff --git a/Source/cmSystemTools.cxx b/Source/cmSystemTools.cxx index 379898e..5eef488 100644 --- a/Source/cmSystemTools.cxx +++ b/Source/cmSystemTools.cxx @@ -858,19 +858,13 @@ bool cmSystemTools::DoesFileExistWithExtensions( bool cmSystemTools::cmCopyFile(const char* source, const char* destination) { - mode_t perm = 0; - return cmSystemTools::GetPermissions(source, perm) && - Superclass::CopyFileAlways(source, destination) && - cmSystemTools::SetPermissions(destination, perm); + return Superclass::CopyFileAlways(source, destination); } bool cmSystemTools::CopyFileIfDifferent(const char* source, const char* destination) { - mode_t perm = 0; - return cmSystemTools::GetPermissions(source, perm) && - Superclass::CopyFileIfDifferent(source, destination) && - cmSystemTools::SetPermissions(destination, perm); + return Superclass::CopyFileIfDifferent(source, destination); } void cmSystemTools::Glob(const char *directory, const char *regexp, @@ -1283,36 +1277,3 @@ bool cmSystemTools::PutEnv(const char* value) return ret == 0; } -bool cmSystemTools::GetPermissions(const char* file, mode_t& mode) -{ - if ( !file ) - { - return false; - } - - struct stat st; - if ( stat(file, &st) < 0 ) - { - return false; - } - mode = st.st_mode; - return true; -} - -bool cmSystemTools::SetPermissions(const char* file, mode_t mode) -{ - if ( !file ) - { - return false; - } - if ( !cmSystemTools::FileExists(file) ) - { - return false; - } - if ( chmod(file, mode) < 0 ) - { - return false; - } - - return true; -} |