summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBill Hoffman <bill.hoffman@kitware.com>2002-03-05 23:25:13 (GMT)
committerBill Hoffman <bill.hoffman@kitware.com>2002-03-05 23:25:13 (GMT)
commit2b9140f6b512784f65dfa58ff1b9076fd6f9227d (patch)
treeb89ed915f6365763e3d2fb1f74d8c6ab7a593752
parent17b6c98c1929b16ec758231e7a5e3b370c1b7d27 (diff)
downloadCMake-2b9140f6b512784f65dfa58ff1b9076fd6f9227d.zip
CMake-2b9140f6b512784f65dfa58ff1b9076fd6f9227d.tar.gz
CMake-2b9140f6b512784f65dfa58ff1b9076fd6f9227d.tar.bz2
BUG: get the correct return value from pclose
-rw-r--r--Source/cmSystemTools.cxx6
1 files changed, 6 insertions, 0 deletions
diff --git a/Source/cmSystemTools.cxx b/Source/cmSystemTools.cxx
index f3305f4..8d677a2 100644
--- a/Source/cmSystemTools.cxx
+++ b/Source/cmSystemTools.cxx
@@ -27,6 +27,7 @@
#include <limits.h>
#include <stdlib.h>
#include <sys/param.h>
+#include <sys/wait.h>
#endif
#if defined(_MSC_VER) || defined(__BORLANDC__)
@@ -1019,6 +1020,8 @@ bool cmSystemTools::RunCommand(const char* command,
{
std::cout << "running " << command << std::endl;
}
+ fflush(stdout);
+ fflush(stderr);
FILE* cpipe = popen(command, "r");
if(!cpipe)
{
@@ -1034,7 +1037,10 @@ bool cmSystemTools::RunCommand(const char* command,
output += buffer;
fgets(buffer, BUFFER_SIZE, cpipe);
}
+
retVal = pclose(cpipe);
+ retVal = WEXITSTATUS(retVal);
+ std::cout << "*** cmSystemTools: return value from " << command << " is "<< retVal << "\n";
return true;
#endif
}