On 2/11/11 6:35 PM, Linus Torvalds wrote:
> On Fri, Feb 11, 2011 at 1:30 PM, Linus Torvalds
> <torva...@linux-foundation.org> wrote:
>>
>> The other case is that the child process was quick and already exited.
>> You get ^C, but the child never did. When you do the waitpid(), you'll
>> never get the EINTR, because there was no actual wait.
> 
> Ok, so here's a suggested patch. It took much longer than expected,
> because I found another independent race while trying to fix this:
> bash did the "restore_sigint_handler()" _after_ having already tested
> the "wait_sigint_received" value, so what could happen is that the
> SIGINT would happen _after_ the test of that flag, but before the
> signal handler was restored, so bash would (once more) drop the ^C on
> the floor.

The patch looks good.  I'll take a closer look and probably produce a
patch for bash-4.2 based on it.  Thanks for taking a look.

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

Reply via email to