summaryrefslogtreecommitdiffstats
path: root/Source/cmSystemTools.cxx
diff options
context:
space:
mode:
authorJonathan Marler <johnnymarler@gmail.com>2017-09-19 15:07:27 (GMT)
committerBrad King <brad.king@kitware.com>2017-09-20 18:17:13 (GMT)
commitc2d6835c178b37301c3d0cec9e575c59913fd617 (patch)
treeb44e95a7b0624eb82d21416d9c2cf6c74e942aa9 /Source/cmSystemTools.cxx
parent95df03a1d44d48b5407dd0ddc9e618ce2f17762b (diff)
downloadCMake-c2d6835c178b37301c3d0cec9e575c59913fd617.zip
CMake-c2d6835c178b37301c3d0cec9e575c59913fd617.tar.gz
CMake-c2d6835c178b37301c3d0cec9e575c59913fd617.tar.bz2
cmSystemTools: Teach RunSingleCommand another way to report exceptions
If the caller captures stdout but not stderr then report exceptions through stdout instead of dropping them.
Diffstat (limited to 'Source/cmSystemTools.cxx')
-rw-r--r--Source/cmSystemTools.cxx4
1 files changed, 4 insertions, 0 deletions
diff --git a/Source/cmSystemTools.cxx b/Source/cmSystemTools.cxx
index 5f2737d..e548b1f 100644
--- a/Source/cmSystemTools.cxx
+++ b/Source/cmSystemTools.cxx
@@ -803,6 +803,8 @@ bool cmSystemTools::RunSingleCommand(std::vector<std::string> const& command,
}
if (captureStdErr) {
captureStdErr->append(exception_str, strlen(exception_str));
+ } else if (captureStdOut) {
+ captureStdOut->append(exception_str, strlen(exception_str));
}
result = false;
} else if (cmsysProcess_GetState(cp) == cmsysProcess_State_Error) {
@@ -812,6 +814,8 @@ bool cmSystemTools::RunSingleCommand(std::vector<std::string> const& command,
}
if (captureStdErr) {
captureStdErr->append(error_str, strlen(error_str));
+ } else if (captureStdOut) {
+ captureStdOut->append(error_str, strlen(error_str));
}
result = false;
} else if (cmsysProcess_GetState(cp) == cmsysProcess_State_Expired) {