bug-bash
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [BUG] Bash not reacting to Ctrl-C


From: Chet Ramey
Subject: Re: [BUG] Bash not reacting to Ctrl-C
Date: Fri, 11 Feb 2011 15:21:19 -0500
User-agent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.5; en-US; rv:1.9.2.13) Gecko/20101207 Thunderbird/3.1.7

On 2/11/11 3:01 PM, Linus Torvalds wrote:
> On Fri, Feb 11, 2011 at 8:57 AM, Illia Bobyr
> <Illia.Bobyr@ronin-capital.com> wrote:
>> On 2/9/2011 3:57 PM, Linus Torvalds wrote:
>>>
>>> Here's the scenario:
> 
> I'll quote the scenario again, because you clearly didn't bother to read it.
> 
> Please _READ_ it this time before you answer, ok?
> 
>>>   - wait_for() sets wait_sigint_received to zero (look for the comment
>>> here!), and installs the sigint handler
>>>   - it does other things too, but it does waitchld() that does the
>>> actual waitpid() system call
>>>   - now, imagine the following scenario: the ^C happens just as the
>>> child already exited successfully!
>>>   - so bash itself gets the sigint, and sets wait_sigint_received to 1
> 
> Let me repeat: THE CHILD ALREADY EXITED SUCCESSFULLY. IT NEVER SAW THE ^C.
> 
> So 'bash' saw the ^C that came from the keyboard. And the exit status
> from the child does NOT show SIGINT, because the child never saw it.

You do realize that this case is indistinguishable from the original
scenario in question: the child gets the SIGINT, handles it, and exits
successfully (or not).  Have you actually not followed the discussion?

Chet
-- 
``The lyf so short, the craft so long to lerne.'' - Chaucer
                 ``Ars longa, vita brevis'' - Hippocrates
Chet Ramey, ITS, CWRU    chet@case.edu    http://cnswww.cns.cwru.edu/~chet/



reply via email to

[Prev in Thread] Current Thread [Next in Thread]