summaryrefslogtreecommitdiffstats
path: root/Source/cmMakefile.cxx
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2020-06-18 13:42:52 (GMT)
committerKitware Robot <kwrobot@kitware.com>2020-06-18 13:43:13 (GMT)
commit2399be054bf09f8598dc5e80825684c85ff0ddbe (patch)
treeecf8e46402e4df54d85a34a489c5efe21d655a9e /Source/cmMakefile.cxx
parent349fb099ebb9bf3abae7365a78d8b9a5da9e65b5 (diff)
parent032506acc6db710d2b402f0d17ae678a0d6e8406 (diff)
downloadCMake-2399be054bf09f8598dc5e80825684c85ff0ddbe.zip
CMake-2399be054bf09f8598dc5e80825684c85ff0ddbe.tar.gz
CMake-2399be054bf09f8598dc5e80825684c85ff0ddbe.tar.bz2
Merge topic 'configure_file-error-handling'
032506acc6 cmake: implement error handling in configure_file Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !4889
Diffstat (limited to 'Source/cmMakefile.cxx')
-rw-r--r--Source/cmMakefile.cxx10
1 files changed, 9 insertions, 1 deletions
diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx
index 5c3063b..fa91059 100644
--- a/Source/cmMakefile.cxx
+++ b/Source/cmMakefile.cxx
@@ -4027,6 +4027,8 @@ int cmMakefile::ConfigureFile(const std::string& infile,
if (copyonly) {
if (!cmSystemTools::CopyFileIfDifferent(sinfile, soutfile)) {
+ this->IssueMessage(MessageType::FATAL_ERROR,
+ cmSystemTools::GetLastSystemError());
return 0;
}
} else {
@@ -4077,9 +4079,15 @@ int cmMakefile::ConfigureFile(const std::string& infile,
fin.close();
fout.close();
if (!cmSystemTools::CopyFileIfDifferent(tempOutputFile, soutfile)) {
+ this->IssueMessage(MessageType::FATAL_ERROR,
+ cmSystemTools::GetLastSystemError());
res = 0;
} else {
- cmSystemTools::SetPermissions(soutfile, perm);
+ if (!cmSystemTools::SetPermissions(soutfile, perm)) {
+ this->IssueMessage(MessageType::FATAL_ERROR,
+ cmSystemTools::GetLastSystemError());
+ res = 0;
+ }
}
cmSystemTools::RemoveFile(tempOutputFile);
}