This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC 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: Rev 146953 seems not to work proper for mingw targets


2009/5/14 Julian Brown <julian@codesourcery.com>:
> Hi Kai,
>
> On Wed, 13 May 2009 20:05:42 +0200
> Kai Tietz <ktietz70@googlemail.com> wrote:
>
>> Hello,
>>
>> the patch at http://gcc.gnu.org/ml/gcc-cvs/2009-04/msg01599.html
>> breaks things for mingw target. I am a bit curious that you duplicate
>> handles here (which is ok so far), but also close origin without
>> checking for standard handles. The checks existing like
>> ...
>> ? if (in != STDIN_FILENO)
>> ? ? _close (in);
>> ? if (out != STDOUT_FILENO)
>> ...
>>
>> will close it always, because the _dup'ed handle will never have value
>> STDIN_FILENO for sure. What is the intension of this patch? It looks a
>> bit wired and wrong so far.
>
> It cleared up an issue we were having where the child program blocked
> forever after the parent died. It seems to be a fairly common problem
> with pipes on win32, IIUC. I seem to have mangled the fix a bit
> though!
>
> Can you try the attached patch (sorry, against an earlier version of
> the patch in our tree, but the required changes are obvious) to see if
> it works to fix your problem? It still seems to fix our original issue,
> FWIW.
>
> Thanks,
>
> Julian
>
> ChangeLog
>
> ? ?libiberty/
> ? ?* pex-win32.c (pex_win32_exec_child): Fix logic to avoid closing
> ? ?standard handles (stdin, stdout, stderr) in parent.
>

Yes, it works again.

Thanks,
Kai

-- 
|  (\_/) This is Bunny. Copy and paste
| (='.'=) Bunny into your signature to help
| (")_(") him gain world domination


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