On 4/1/12 5:53 AM, Andreas Schwab wrote:

>> It looks like a simple race condition.  I suspect that the scheduler
>> arranges things so that the child process ends up exiting between the
>> open and the read, but I don't have any real evidence to back it up.
> 
> Note that the opening of the pipe as part of the redirection in the
> parent blocks until there is a writer, ie. until the child opens the
> pipe.  Can this open call return EINTR?

open() is supposed to return EINTR only if interrupted by a signal.  The
only signal I can see occurring is SIGCHLD, and bash installs the SIGCHLD
handler with SA_RESTART.

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