fixed IO redirection to work in wxExecute() in console applications (including the case when the child process outputs more than pipe buffer size) by using wxSelectDispatcher for multiplexing

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@52692 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
2008-03-22 14:10:54 +00:00
parent a83ca5fbf5
commit 33343395da
3 changed files with 177 additions and 73 deletions

View File

@@ -40,9 +40,22 @@ struct wxExecuteData
#if wxUSE_STREAMS
bufOut =
bufErr = NULL;
fdOut =
fdErr = wxPipe::INVALID_FD;
#endif // wxUSE_STREAMS
}
// get the FD corresponding to the read end of the process end detection
// pipe and close the write one
int GetEndProcReadFD()
{
const int fd = pipeEndProcDetect.Detach(wxPipe::Read);
pipeEndProcDetect.Close();
return fd;
}
// wxExecute() flags
int flags;
@@ -60,6 +73,10 @@ struct wxExecuteData
// called bufOut and not bufIn
wxStreamTempInputBuffer *bufOut,
*bufErr;
// the corresponding FDs, -1 if not redirected
int fdOut,
fdErr;
#endif // wxUSE_STREAMS
};