On 2/11/11 3:01 PM, Linus Torvalds wrote:
> On Fri, Feb 11, 2011 at 8:57 AM, Illia Bobyr
> <[email protected]> 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 [email protected] http://cnswww.cns.cwru.edu/~chet/