Chet Ramey <chet.ra...@case.edu> writes:

> On 3/31/12 9:19 AM, Lluís Batlle i Rossell wrote:
>> Hello,
>> 
>> I have this script, that I've found to never write "DONE" in my systems, with
>> bash 4.0, 4.1, 4.2.. until 4.2-p20, my last test.
>> 
>> However, in irc some people told me it prints DONE for them. If I run the 
>> script with
>> bash under 'strace -f', it also prints DONE.
>
> 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?

Andreas.

-- 
Andreas Schwab, sch...@linux-m68k.org
GPG Key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."

Reply via email to