This is the mail archive of the binutils@sourceware.org mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]