diff options
Diffstat (limited to 'Source/kwsys/ProcessWin32.c')
-rw-r--r-- | Source/kwsys/ProcessWin32.c | 12 |
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) { |