summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKen Martin <ken.martin@kitware.com>2007-03-28 15:06:34 (GMT)
committerKen Martin <ken.martin@kitware.com>2007-03-28 15:06:34 (GMT)
commitf0857fcbd32632731a1a7430463a897befc9844e (patch)
tree3ab82746d6a8c8ea6cda59bf9c4105fd9b19fd65
parentc6cf2ca1087620b5b9b18115bdb991521a7742ff (diff)
downloadCMake-f0857fcbd32632731a1a7430463a897befc9844e.zip
CMake-f0857fcbd32632731a1a7430463a897befc9844e.tar.gz
CMake-f0857fcbd32632731a1a7430463a897befc9844e.tar.bz2
BUG: even safer checking of return value
-rw-r--r--Source/CTest/cmCTestBuildHandler.cxx49
1 files changed, 27 insertions, 22 deletions
diff --git a/Source/CTest/cmCTestBuildHandler.cxx b/Source/CTest/cmCTestBuildHandler.cxx
index 8f32ccd..52945bb 100644
--- a/Source/CTest/cmCTestBuildHandler.cxx
+++ b/Source/CTest/cmCTestBuildHandler.cxx
@@ -692,30 +692,35 @@ int cmCTestBuildHandler::RunMakeCommand(const char* command,
if(result == cmsysProcess_State_Exited)
{
- *retVal = cmsysProcess_GetExitValue(cp);
- cmCTestLog(this->CTest, HANDLER_VERBOSE_OUTPUT,
- "Command exited with the value: " << *retVal << std::endl);
- // if a non zero return value
- if (retVal && *retVal)
+ if (retVal)
{
- // If there was an error running command, report that on the dashboard.
- cmCTestBuildErrorWarning errorwarning;
- errorwarning.LogLine = 1;
- errorwarning.Text
- = "*** WARNING non-zero return value in ctest from: ";
- errorwarning.Text += argv[0];
- errorwarning.PreContext = "";
- errorwarning.PostContext = "";
- errorwarning.Error = false;
- this->ErrorsAndWarnings.push_back(errorwarning);
- this->TotalWarnings ++;
+ *retVal = cmsysProcess_GetExitValue(cp);
+ cmCTestLog(this->CTest, HANDLER_VERBOSE_OUTPUT,
+ "Command exited with the value: " << *retVal << std::endl);
+ // if a non zero return value
+ if (*retVal)
+ {
+ // If there was an error running command, report that on the dashboard.
+ cmCTestBuildErrorWarning errorwarning;
+ errorwarning.LogLine = 1;
+ errorwarning.Text
+ = "*** WARNING non-zero return value in ctest from: ";
+ errorwarning.Text += argv[0];
+ errorwarning.PreContext = "";
+ errorwarning.PostContext = "";
+ errorwarning.Error = false;
+ this->ErrorsAndWarnings.push_back(errorwarning);
+ this->TotalWarnings ++;
+ }
}
- }
- else if(result == cmsysProcess_State_Exception)
- {
- *retVal = cmsysProcess_GetExitException(cp);
- cmCTestLog(this->CTest, WARNING, "There was an exception: " << *retVal
- << std::endl);
+ else if(result == cmsysProcess_State_Exception)
+ {
+ if (retVal)
+ {
+ *retVal = cmsysProcess_GetExitException(cp);
+ cmCTestLog(this->CTest, WARNING, "There was an exception: " << *retVal
+ << std::endl);
+ }
}
else if(result == cmsysProcess_State_Expired)
{