don't close end process pipe descriptor too early (fixes bug introduced by the last check in)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@16155 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -666,12 +666,6 @@ long wxExecute(wxChar **argv,
|
|||||||
}
|
}
|
||||||
else if ( pid == 0 ) // we're in child
|
else if ( pid == 0 ) // we're in child
|
||||||
{
|
{
|
||||||
#if wxUSE_GUI
|
|
||||||
// reading side can be safely closed but we should keep the write one
|
|
||||||
// opened
|
|
||||||
pipeEndProcDetect.Detach(wxPipe::Write);
|
|
||||||
#endif // wxUSE_GUI
|
|
||||||
|
|
||||||
// These lines close the open file descriptors to to avoid any
|
// These lines close the open file descriptors to to avoid any
|
||||||
// input/output which might block the process or irritate the user. If
|
// input/output which might block the process or irritate the user. If
|
||||||
// one wants proper IO for the subprocess, the right thing to do is to
|
// one wants proper IO for the subprocess, the right thing to do is to
|
||||||
@@ -696,6 +690,7 @@ long wxExecute(wxChar **argv,
|
|||||||
if ( fd != STDERR_FILENO )
|
if ( fd != STDERR_FILENO )
|
||||||
close(fd);
|
close(fd);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
#ifndef __VMS
|
#ifndef __VMS
|
||||||
if ( flags & wxEXEC_MAKE_GROUP_LEADER )
|
if ( flags & wxEXEC_MAKE_GROUP_LEADER )
|
||||||
@@ -705,7 +700,13 @@ long wxExecute(wxChar **argv,
|
|||||||
setsid();
|
setsid();
|
||||||
}
|
}
|
||||||
#endif // !__VMS
|
#endif // !__VMS
|
||||||
}
|
|
||||||
|
#if wxUSE_GUI
|
||||||
|
// reading side can be safely closed but we should keep the write one
|
||||||
|
// opened
|
||||||
|
pipeEndProcDetect.Detach(wxPipe::Write);
|
||||||
|
pipeEndProcDetect.Close();
|
||||||
|
#endif // wxUSE_GUI
|
||||||
|
|
||||||
// redirect stdin, stdout and stderr
|
// redirect stdin, stdout and stderr
|
||||||
if ( pipeIn.IsOk() )
|
if ( pipeIn.IsOk() )
|
||||||
|
Reference in New Issue
Block a user