summaryrefslogtreecommitdiffstats
path: root/Source/kwsys/ProcessWin32.c
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2003-12-07 19:09:58 (GMT)
committerBrad King <brad.king@kitware.com>2003-12-07 19:09:58 (GMT)
commitb777b8656e2ea28a165c22a3c1f7a1a1dd1b11a7 (patch)
tree110e32b1ff34d4ef72c411e68c403bb1a77973b9 /Source/kwsys/ProcessWin32.c
parent21c5c6c81d753ddc50e1bb1236a08ff014ffba69 (diff)
downloadCMake-b777b8656e2ea28a165c22a3c1f7a1a1dd1b11a7.zip
CMake-b777b8656e2ea28a165c22a3c1f7a1a1dd1b11a7.tar.gz
CMake-b777b8656e2ea28a165c22a3c1f7a1a1dd1b11a7.tar.bz2
ENH: Cleaned up pipe numbering.
Diffstat (limited to 'Source/kwsys/ProcessWin32.c')
-rw-r--r--Source/kwsys/ProcessWin32.c16
1 files changed, 11 insertions, 5 deletions
diff --git a/Source/kwsys/ProcessWin32.c b/Source/kwsys/ProcessWin32.c
index fd4ddd0..07a7855 100644
--- a/Source/kwsys/ProcessWin32.c
+++ b/Source/kwsys/ProcessWin32.c
@@ -931,14 +931,14 @@ int kwsysProcess_WaitForData(kwsysProcess* cp, char** data, int* length,
int user;
int done = 0;
int expired = 0;
- int pipeId = 0;
+ int pipeId = kwsysProcess_Pipe_None;
DWORD w;
/* Make sure we are executing a process. */
if(cp->State != kwsysProcess_State_Executing || cp->Killed ||
cp->TimeoutExpired)
{
- return 0;
+ return kwsysProcess_Pipe_None;
}
/* Record the time at which user timeout period starts. */
@@ -1002,7 +1002,13 @@ int kwsysProcess_WaitForData(kwsysProcess* cp, char** data, int* length,
/* Report this data. */
*data = cp->Pipe[cp->CurrentIndex].DataBuffer;
*length = cp->Pipe[cp->CurrentIndex].DataLength;
- pipeId = (1 << cp->CurrentIndex);
+ switch(cp->CurrentIndex)
+ {
+ case KWSYSPE_PIPE_STDOUT:
+ pipeId = kwsysProcess_Pipe_STDOUT; break;
+ case KWSYSPE_PIPE_STDERR:
+ pipeId = kwsysProcess_Pipe_STDERR; break;
+ }
done = 1;
}
}
@@ -1047,13 +1053,13 @@ int kwsysProcess_WaitForData(kwsysProcess* cp, char** data, int* length,
kwsysProcess_Kill(cp);
cp->TimeoutExpired = 1;
cp->Killed = 0;
- return 0;
+ return kwsysProcess_Pipe_None;
}
}
else
{
/* The children have terminated and no more data are available. */
- return 0;
+ return kwsysProcess_Pipe_None;
}
}