summaryrefslogtreecommitdiffstats
path: root/Source
diff options
context:
space:
mode:
authorBill Hoffman <bill.hoffman@kitware.com>2001-07-05 21:52:31 (GMT)
committerBill Hoffman <bill.hoffman@kitware.com>2001-07-05 21:52:31 (GMT)
commit05fb9379efa81ae3b4de42ee3055586b52298dff (patch)
tree07ab19605d9cdc7f7205371da08d583866e87898 /Source
parent863ca7d0e205fb89f57fcdb63423e7ff17631e40 (diff)
downloadCMake-05fb9379efa81ae3b4de42ee3055586b52298dff.zip
CMake-05fb9379efa81ae3b4de42ee3055586b52298dff.tar.gz
CMake-05fb9379efa81ae3b4de42ee3055586b52298dff.tar.bz2
ENH: add better error output
Diffstat (limited to 'Source')
-rw-r--r--Source/cmSystemTools.cxx12
1 files changed, 9 insertions, 3 deletions
diff --git a/Source/cmSystemTools.cxx b/Source/cmSystemTools.cxx
index 8f20ec5..b7e7cf1 100644
--- a/Source/cmSystemTools.cxx
+++ b/Source/cmSystemTools.cxx
@@ -780,9 +780,14 @@ bool cmSystemTools::RunCommand(const char* command,
std::ifstream fin(tempFile.c_str());
if(!fin)
{
- cmSystemTools::Error(command,
- " from RunCommand Failed to create output file: ",
- tempFile.c_str());
+ std::string errormsg = "RunCommand produced no output: command: \"";
+ errormsg += command;
+ errormsg += "\"";
+ errormsg += "\nOutput file: ";
+ errormsg += tempFile;
+ cmSystemTools::Error(errormsg.c_str());
+ fin.close();
+ cmSystemTools::RemoveFile(tempFile.c_str());
return false;
}
while(fin)
@@ -790,6 +795,7 @@ bool cmSystemTools::RunCommand(const char* command,
fin.getline(buffer, BUFFER_SIZE);
output += buffer;
}
+ fin.close();
cmSystemTools::RemoveFile(tempFile.c_str());
return true;
#else