This is the mail archive of the
cygwin
mailing list for the Cygwin project.
Re: 1.7.9 Missing SIGPIPE?
- From: Christopher Faylor <cgf-use-the-mailinglist-please at cygwin dot com>
- To: cygwin at cygwin dot com
- Date: Tue, 4 Oct 2011 10:09:27 -0400
- Subject: Re: 1.7.9 Missing SIGPIPE?
- References: <4E833CB4.3060004@lysator.liu.se> <4E8B0FC6.9050600@lysator.liu.se> <4E8B116D.3030905@gmail.com>
- Reply-to: cygwin at cygwin dot com
On Tue, Oct 04, 2011 at 04:00:13PM +0200, Marco Atzeri wrote:
>On 10/4/2011 3:53 PM, Peter Rosin wrote:
>> Peter Rosin skrev 2011-09-28 17:26:
>>> Hi!
>>>
>>> When I use bash to build pipelines, they sometimes don't finish but
>>> instead some process remains running. Example:
>>>
>>> $ tail -f -n 10000 log.txt | grep . | head -n 2
>>>
>>> Almost instantly I get the expected two lines of output, but no prompt
>>> back. I have to use ctrl-c. If I don't ctrl-c I can run pstree in
>>> another terminal and see this:
>>>
>>> $ pstree
>>> ??????????mintty?????????bash?????????tail
>>> ??????mintty?????????bash?????????pstree
>>
>> This example is a poor one, as tail simply waits for a new line, when it
>> gets a new line it forwards it to the pipe and promptly receives a
>> SIGPIPE as grep is not there anymore.
>>
>> I'll get back when I have distilled a better STC. If I can...
>
>Hi Peter,
>are you referring on something like SIGHUP on PTY closure ?
>
>http://cygwin.com/ml/cygwin/2011-07/msg00295.html
>http://pubs.opengroup.org/onlinepubs/9699919799/functions/close.html
Note that this thread contains your assertion that something isn't
happening correctly but it isn't clear that your analysis is correct.
But, no, SIGPIPE != SIGHUP and the above example clearly shows a
completely different scenario than what is described in the above
thread.
cgf
--
Problem reports: http://cygwin.com/problems.html
FAQ: http://cygwin.com/faq/
Documentation: http://cygwin.com/docs.html
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple