summaryrefslogtreecommitdiff
path: root/Source/cmCTest.cxx
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2021-04-14 12:15:54 -0400
committerBrad King <brad.king@kitware.com>2021-04-14 13:14:09 -0400
commitec1b6157cbfefdcac5c971021a5700dd80318a09 (patch)
treecf77e28ebb95ce81ec4fa7b91c674bfe62b378cd /Source/cmCTest.cxx
parenteef585efaa49d546a9af2939a147c971c76de03e (diff)
downloadcmake-ec1b6157cbfefdcac5c971021a5700dd80318a09.tar.gz
Update CMake code using KWSys to account for Status return values
KWSys as of 2021-04-14 changed the return type of `SystemTools` operations from `bool` to `Status`. Update our call sites. This may improve error reporting accuracy in a few places.
Diffstat (limited to 'Source/cmCTest.cxx')
-rw-r--r--Source/cmCTest.cxx6
1 files changed, 3 insertions, 3 deletions
diff --git a/Source/cmCTest.cxx b/Source/cmCTest.cxx
index 0dfd1bd4fa..643b43f6dd 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;
}