summaryrefslogtreecommitdiffstats
path: root/Source/cmSystemTools.cxx
diff options
context:
space:
mode:
authorBill Hoffman <bill.hoffman@kitware.com>2007-09-25 14:57:49 (GMT)
committerBill Hoffman <bill.hoffman@kitware.com>2007-09-25 14:57:49 (GMT)
commit9c3ffe2474a1ed0280a35e00ff034b1866d9cec4 (patch)
tree06deb5fa431dd9cdc98ef4ec47735670eb71e7a2 /Source/cmSystemTools.cxx
parent80e0dd8c05242f0f3cbbe2c901f1159e9e4bc910 (diff)
downloadCMake-9c3ffe2474a1ed0280a35e00ff034b1866d9cec4.zip
CMake-9c3ffe2474a1ed0280a35e00ff034b1866d9cec4.tar.gz
CMake-9c3ffe2474a1ed0280a35e00ff034b1866d9cec4.tar.bz2
BUG: fix problem with stdout and stderr not showing up in ms dos shells
Diffstat (limited to 'Source/cmSystemTools.cxx')
-rw-r--r--Source/cmSystemTools.cxx12
1 files changed, 11 insertions, 1 deletions
diff --git a/Source/cmSystemTools.cxx b/Source/cmSystemTools.cxx
index 5ed8a75..2f5bb5b 100644
--- a/Source/cmSystemTools.cxx
+++ b/Source/cmSystemTools.cxx
@@ -1979,7 +1979,17 @@ int cmSystemTools::WaitForLine(cmsysProcess* process, std::string& line,
void cmSystemTools::DoNotInheritStdPipes()
{
-#ifdef _WIN32
+#ifdef _WIN32
+ // Check to see if we are attached to a console
+ // if so, then do not stop the inherited pipes
+ // or stdout and stderr will not show up in dos
+ // shell windows
+ CONSOLE_SCREEN_BUFFER_INFO hOutInfo;
+ HANDLE hOut = GetStdHandle(STD_OUTPUT_HANDLE);
+ if(GetConsoleScreenBufferInfo(hOut, &hOutInfo))
+ {
+ return;
+ }
{
HANDLE out = GetStdHandle(STD_OUTPUT_HANDLE);
DuplicateHandle(GetCurrentProcess(), out,