summaryrefslogtreecommitdiffstats
path: root/Source/kwsys/ProcessWin32.c
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2003-12-05 16:53:17 (GMT)
committerBrad King <brad.king@kitware.com>2003-12-05 16:53:17 (GMT)
commited853b5d70649465370f161b774cf91735a822b3 (patch)
tree23a96d8eba86efd8aa124fd49ca3319689ba02ae /Source/kwsys/ProcessWin32.c
parent97b469537bffbedf2cfbc9c58f208b2641b1544a (diff)
downloadCMake-ed853b5d70649465370f161b774cf91735a822b3.zip
CMake-ed853b5d70649465370f161b774cf91735a822b3.tar.gz
CMake-ed853b5d70649465370f161b774cf91735a822b3.tar.bz2
ENH: Removed pipe selection argument from WaitForData method in kwsysProcess. This greatly simplifies its use.
Diffstat (limited to 'Source/kwsys/ProcessWin32.c')
-rw-r--r--Source/kwsys/ProcessWin32.c12
1 files changed, 4 insertions, 8 deletions
diff --git a/Source/kwsys/ProcessWin32.c b/Source/kwsys/ProcessWin32.c
index 7317cf7..fd4ddd0 100644
--- a/Source/kwsys/ProcessWin32.c
+++ b/Source/kwsys/ProcessWin32.c
@@ -921,7 +921,7 @@ void kwsysProcess_Execute(kwsysProcess* cp)
/*--------------------------------------------------------------------------*/
-int kwsysProcess_WaitForData(kwsysProcess* cp, int pipes, char** data, int* length,
+int kwsysProcess_WaitForData(kwsysProcess* cp, char** data, int* length,
double* userTimeout)
{
kwsysProcessTime userStartTime;
@@ -997,18 +997,14 @@ int kwsysProcess_WaitForData(kwsysProcess* cp, int pipes, char** data, int* leng
/* The pipe closed. */
--cp->PipesLeft;
}
- else if(pipes & (1 << cp->CurrentIndex))
+ else if(data && length)
{
- /* Caller wants this data. Report it. */
+ /* Report this data. */
*data = cp->Pipe[cp->CurrentIndex].DataBuffer;
*length = cp->Pipe[cp->CurrentIndex].DataLength;
pipeId = (1 << cp->CurrentIndex);
done = 1;
}
- else
- {
- /* Caller does not care about this pipe. Ignore the data. */
- }
}
else
{
@@ -1074,7 +1070,7 @@ int kwsysProcess_WaitForExit(kwsysProcess* cp, double* userTimeout)
}
/* Wait for the process to terminate. Ignore all data. */
- while((pipe = kwsysProcess_WaitForData(cp, 0, 0, 0, userTimeout)) > 0)
+ while((pipe = kwsysProcess_WaitForData(cp, 0, 0, userTimeout)) > 0)
{
if(pipe == kwsysProcess_Pipe_Timeout)
{