[PATCH, libiberty] Pex pipes block under win32 when parent process dies

Ian Lance Taylor iant@google.com
Mon Apr 27 21:17:00 GMT 2009


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



More information about the Gcc-patches mailing list