libiberty/
* pex-win32.c (pex_win32_exec_child): Fix logic to avoid closing standard handles (stdin, stdout, stderr) in parent.
This commit is contained in:
parent
d5f3b87372
commit
ed20019d73
|
@ -1,3 +1,8 @@
|
||||||
|
2009-05-17 Julian Brown <julian@codesourcery.com>
|
||||||
|
|
||||||
|
* pex-win32.c (pex_win32_exec_child): Fix logic to avoid closing
|
||||||
|
standard handles (stdin, stdout, stderr) in parent.
|
||||||
|
|
||||||
2009-04-29 Julian Brown <julian@codesourcery.com>
|
2009-04-29 Julian Brown <julian@codesourcery.com>
|
||||||
|
|
||||||
* pex-win32.c (pex_win32_pipe): Add _O_NOINHERIT.
|
* pex-win32.c (pex_win32_pipe): Add _O_NOINHERIT.
|
||||||
|
|
|
@ -753,16 +753,19 @@ pex_win32_exec_child (struct pex_obj *obj ATTRIBUTE_UNUSED, int flags,
|
||||||
original descriptors. */
|
original descriptors. */
|
||||||
orig_in = in;
|
orig_in = in;
|
||||||
in = _dup (orig_in);
|
in = _dup (orig_in);
|
||||||
|
if (orig_in != STDIN_FILENO)
|
||||||
_close (orig_in);
|
_close (orig_in);
|
||||||
|
|
||||||
orig_out = out;
|
orig_out = out;
|
||||||
out = _dup (orig_out);
|
out = _dup (orig_out);
|
||||||
|
if (orig_out != STDOUT_FILENO)
|
||||||
_close (orig_out);
|
_close (orig_out);
|
||||||
|
|
||||||
if (separate_stderr)
|
if (separate_stderr)
|
||||||
{
|
{
|
||||||
orig_err = errdes;
|
orig_err = errdes;
|
||||||
errdes = _dup (orig_err);
|
errdes = _dup (orig_err);
|
||||||
|
if (orig_err != STDERR_FILENO)
|
||||||
_close (orig_err);
|
_close (orig_err);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -844,11 +847,9 @@ pex_win32_exec_child (struct pex_obj *obj ATTRIBUTE_UNUSED, int flags,
|
||||||
/* Close the standard input, standard output and standard error handles
|
/* Close the standard input, standard output and standard error handles
|
||||||
in the parent. */
|
in the parent. */
|
||||||
|
|
||||||
if (in != STDIN_FILENO)
|
|
||||||
_close (in);
|
_close (in);
|
||||||
if (out != STDOUT_FILENO)
|
|
||||||
_close (out);
|
_close (out);
|
||||||
if (errdes != STDERR_FILENO)
|
if (separate_stderr)
|
||||||
_close (errdes);
|
_close (errdes);
|
||||||
|
|
||||||
return pid;
|
return pid;
|
||||||
|
|
Loading…
Reference in New Issue