This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: [PATCH, libiberty] Pex pipes block under win32 when parent process dies
- From: Ian Lance Taylor <iant at google dot com>
- To: Julian Brown <julian at codesourcery dot com>
- Cc: gdb-patches at sourceware dot org, gcc-patches at gcc dot gnu dot org, binutils at sourceware dot org
- Date: Mon, 27 Apr 2009 13:55:47 -0700
- Subject: Re: [PATCH, libiberty] Pex pipes block under win32 when parent process dies
- References: <20090427153649.53adf4f0@rex.config>
Julian Brown <julian@codesourcery.com> writes:
> libiberty/
> * pex-win32.c (pex_win32_pipe): Add _O_NOINHERIT.
> (pex_win32_exec_child): Ensure each process has only one handle
> open on pipe endpoints. Close standard input after creating child
> for symmetry with standard output/standard error.
> + /* Ensure we have inheritable descriptors to pass to the child, and close the
> + original descriptors. */
> + orig_in = in;
> + in = _dup (orig_in);
> + obj->funcs->close (obj, orig_in);
You can just call _close, here and below (i.e., change the existing
code). obj->funcs->close is always going to be pex_win32_close. I
don't see any need to do the indirection. That would mean not removing
the ATTRIBUTE_UNUSED on obj.
OK with that change.
Thanks.
Ian