diff options
-rw-r--r-- | Source/CPack/cmCPackSTGZGenerator.cxx | 13 | ||||
-rw-r--r-- | Source/CTest/cmCTestScriptHandler.cxx | 2 | ||||
-rw-r--r-- | Source/CTest/cmCTestTestHandler.cxx | 2 | ||||
-rw-r--r-- | Source/cmCTest.cxx | 6 | ||||
-rw-r--r-- | Source/cmConditionEvaluator.cxx | 4 | ||||
-rw-r--r-- | Source/cmFileCommand.cxx | 9 | ||||
-rw-r--r-- | Source/cmQtAutoGenerator.cxx | 2 | ||||
-rw-r--r-- | Source/cmSystemTools.cxx | 4 | ||||
-rw-r--r-- | Source/cmSystemTools.h | 1 | ||||
-rw-r--r-- | Source/cmWorkingDirectory.cxx | 2 | ||||
-rw-r--r-- | Source/cmcmd.cxx | 2 | ||||
-rwxr-xr-x | bootstrap | 2 |
12 files changed, 28 insertions, 21 deletions
diff --git a/Source/CPack/cmCPackSTGZGenerator.cxx b/Source/CPack/cmCPackSTGZGenerator.cxx index 3e36e8c..ad0a3e2 100644 --- a/Source/CPack/cmCPackSTGZGenerator.cxx +++ b/Source/CPack/cmCPackSTGZGenerator.cxx @@ -51,15 +51,16 @@ int cmCPackSTGZGenerator::PackageFiles() * so we must iterate over generated packages. */ for (std::string const& pfn : this->packageFileNames) { - retval &= cmSystemTools::SetPermissions(pfn.c_str(), + retval &= static_cast<bool>( + cmSystemTools::SetPermissions(pfn.c_str(), #if defined(_MSC_VER) || defined(__MINGW32__) - S_IREAD | S_IWRITE | S_IEXEC + S_IREAD | S_IWRITE | S_IEXEC #else - S_IRUSR | S_IWUSR | S_IXUSR | - S_IRGRP | S_IWGRP | S_IXGRP | - S_IROTH | S_IWOTH | S_IXOTH + S_IRUSR | S_IWUSR | S_IXUSR | S_IRGRP | + S_IWGRP | S_IXGRP | S_IROTH | S_IWOTH | + S_IXOTH #endif - ); + )); } return retval; } diff --git a/Source/CTest/cmCTestScriptHandler.cxx b/Source/CTest/cmCTestScriptHandler.cxx index ff0b179..d2cad39 100644 --- a/Source/CTest/cmCTestScriptHandler.cxx +++ b/Source/CTest/cmCTestScriptHandler.cxx @@ -921,7 +921,7 @@ bool cmCTestScriptHandler::TryToRemoveBinaryDirectoryOnce( } } - return cmSystemTools::RemoveADirectory(directoryPath); + return static_cast<bool>(cmSystemTools::RemoveADirectory(directoryPath)); } cmDuration cmCTestScriptHandler::GetRemainingTimeAllowed() diff --git a/Source/CTest/cmCTestTestHandler.cxx b/Source/CTest/cmCTestTestHandler.cxx index 742e78a..db5cb9c 100644 --- a/Source/CTest/cmCTestTestHandler.cxx +++ b/Source/CTest/cmCTestTestHandler.cxx @@ -1881,7 +1881,7 @@ void cmCTestTestHandler::ExpandTestsToRunInformationForRerunFailed() std::string dirName = this->CTest->GetBinaryDir() + "/Testing/Temporary"; cmsys::Directory directory; - if (directory.Load(dirName) == 0) { + if (!directory.Load(dirName)) { cmCTestLog(this->CTest, ERROR_MESSAGE, "Unable to read the contents of " << dirName << std::endl); return; diff --git a/Source/cmCTest.cxx b/Source/cmCTest.cxx index 0dfd1bd..643b43f 100644 --- a/Source/cmCTest.cxx +++ b/Source/cmCTest.cxx @@ -4,7 +4,6 @@ #include <algorithm> #include <cctype> -#include <cerrno> #include <chrono> #include <cstdio> #include <cstdlib> @@ -2842,9 +2841,10 @@ int cmCTest::ExecuteTests() cmCTestLog(this, OUTPUT, "Internal ctest changing into directory: " << workDir << std::endl); - if (cmSystemTools::ChangeDirectory(workDir) != 0) { + cmsys::Status status = cmSystemTools::ChangeDirectory(workDir); + if (!status) { auto msg = "Failed to change working directory to \"" + workDir + - "\" : " + std::strerror(errno) + "\n"; + "\" : " + status.GetString() + "\n"; cmCTestLog(this, ERROR_MESSAGE, msg); return 1; } diff --git a/Source/cmConditionEvaluator.cxx b/Source/cmConditionEvaluator.cxx index 62bc526..f99592c 100644 --- a/Source/cmConditionEvaluator.cxx +++ b/Source/cmConditionEvaluator.cxx @@ -654,10 +654,10 @@ bool cmConditionEvaluator::HandleLevel2(cmArgumentList& newArgs, if (argP1 != newArgs.end() && argP2 != newArgs.end() && this->IsKeyword(keyIS_NEWER_THAN, *argP1)) { int fileIsNewer = 0; - bool success = cmSystemTools::FileTimeCompare( + cmsys::Status ftcStatus = cmSystemTools::FileTimeCompare( arg->GetValue(), (argP2)->GetValue(), &fileIsNewer); this->HandleBinaryOp( - (!success || fileIsNewer == 1 || fileIsNewer == 0), reducible, arg, + (!ftcStatus || fileIsNewer == 1 || fileIsNewer == 0), reducible, arg, newArgs, argP1, argP2); } diff --git a/Source/cmFileCommand.cxx b/Source/cmFileCommand.cxx index a06ed48..26bdedf 100644 --- a/Source/cmFileCommand.cxx +++ b/Source/cmFileCommand.cxx @@ -2956,9 +2956,12 @@ bool HandleCreateLinkCommand(std::vector<std::string> const& args, // Check if copy-on-error is enabled in the arguments. if (!completed && arguments.CopyOnError) { - completed = cmsys::SystemTools::CopyFileAlways(fileName, newFileName); - if (!completed) { - result = "Copy failed: " + cmSystemTools::GetLastSystemError(); + cmsys::Status copied = + cmsys::SystemTools::CopyFileAlways(fileName, newFileName); + if (copied) { + completed = true; + } else { + result = "Copy failed: " + copied.GetString(); } } diff --git a/Source/cmQtAutoGenerator.cxx b/Source/cmQtAutoGenerator.cxx index 6e88e26..568926e 100644 --- a/Source/cmQtAutoGenerator.cxx +++ b/Source/cmQtAutoGenerator.cxx @@ -116,7 +116,7 @@ bool cmQtAutoGenerator::MakeParentDirectory(std::string const& filename) bool success = true; std::string const dirName = cmSystemTools::GetFilenamePath(filename); if (!dirName.empty()) { - success = cmSystemTools::MakeDirectory(dirName); + success = static_cast<bool>(cmSystemTools::MakeDirectory(dirName)); } return success; } diff --git a/Source/cmSystemTools.cxx b/Source/cmSystemTools.cxx index 3a438fd..a2a406c 100644 --- a/Source/cmSystemTools.cxx +++ b/Source/cmSystemTools.cxx @@ -1016,7 +1016,7 @@ cmSystemTools::CopyResult cmSystemTools::CopySingleFile( } mode_t perm = 0; - bool perms = SystemTools::GetPermissions(oldname, perm); + cmsys::Status perms = SystemTools::GetPermissions(oldname, perm); // If files are the same do not copy if (SystemTools::SameFile(oldname, newname)) { @@ -3130,7 +3130,7 @@ bool cmSystemTools::RepeatedRemoveDirectory(const std::string& dir) } return false; #else - return cmSystemTools::RemoveADirectory(dir); + return static_cast<bool>(cmSystemTools::RemoveADirectory(dir)); #endif } diff --git a/Source/cmSystemTools.h b/Source/cmSystemTools.h index 5620899..99f20e0 100644 --- a/Source/cmSystemTools.h +++ b/Source/cmSystemTools.h @@ -12,6 +12,7 @@ #include <cm/string_view> #include "cmsys/Process.h" +#include "cmsys/Status.hxx" // IWYU pragma: export #include "cmsys/SystemTools.hxx" // IWYU pragma: export #include "cmCryptoHash.h" diff --git a/Source/cmWorkingDirectory.cxx b/Source/cmWorkingDirectory.cxx index 5700b1c..12fae12 100644 --- a/Source/cmWorkingDirectory.cxx +++ b/Source/cmWorkingDirectory.cxx @@ -19,7 +19,7 @@ cmWorkingDirectory::~cmWorkingDirectory() bool cmWorkingDirectory::SetDirectory(std::string const& newdir) { - if (cmSystemTools::ChangeDirectory(newdir) == 0) { + if (cmSystemTools::ChangeDirectory(newdir)) { this->ResultCode = 0; return true; } diff --git a/Source/cmcmd.cxx b/Source/cmcmd.cxx index 9ba4b93..a47eccd 100644 --- a/Source/cmcmd.cxx +++ b/Source/cmcmd.cxx @@ -1635,7 +1635,7 @@ bool cmcmd::SymlinkInternal(std::string const& file, std::string const& link) cmSystemTools::RemoveFile(link); } #if defined(_WIN32) && !defined(__CYGWIN__) - return cmSystemTools::CopyFileAlways(file, link); + return static_cast<bool>(cmSystemTools::CopyFileAlways(file, link)); #else std::string linktext = cmSystemTools::GetFilenameName(file); return cmSystemTools::CreateSymlink(linktext, link); @@ -525,6 +525,7 @@ KWSYS_CXX_SOURCES="\ FStream \ Glob \ RegularExpression \ + Status \ SystemTools" KWSYS_FILES="\ @@ -535,6 +536,7 @@ KWSYS_FILES="\ Glob.hxx \ Process.h \ RegularExpression.hxx \ + Status.hxx \ String.h \ String.hxx \ System.h \ |