summaryrefslogtreecommitdiffstats
path: root/Source/cmFileCommand.cxx
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2021-04-14 16:15:54 (GMT)
committerBrad King <brad.king@kitware.com>2021-04-14 17:14:09 (GMT)
commitec1b6157cbfefdcac5c971021a5700dd80318a09 (patch)
treecf77e28ebb95ce81ec4fa7b91c674bfe62b378cd /Source/cmFileCommand.cxx
parenteef585efaa49d546a9af2939a147c971c76de03e (diff)
downloadCMake-ec1b6157cbfefdcac5c971021a5700dd80318a09.zip
CMake-ec1b6157cbfefdcac5c971021a5700dd80318a09.tar.gz
CMake-ec1b6157cbfefdcac5c971021a5700dd80318a09.tar.bz2
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/cmFileCommand.cxx')
-rw-r--r--Source/cmFileCommand.cxx9
1 files changed, 6 insertions, 3 deletions
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();
}
}