On 07/20/2010 03:52 PM, Paul Eggert wrote:
> On 07/20/10 14:47, Eric Blake wrote a bunch of good questions,
> ending with:
> 
>> And how does signal handling fit in with interrupting a child test?
> 
> OK, you're right, a plain pipe is not going to work.  How about
> this much-smaller fix instead?  It builds on your idea to make
> sure that the 'read at_token' commands succeed.
> 
> @@ -1410,7 +1410,9 @@ dnl         kill -13 $$
>      fi
>      shift # Consume one token.
>      if test $...@%:@] -gt 0; then :; else
> -      read at_token <&AT_JOB_FIFO_FD || break
> +      # The 'until' loop avoids a race condition if we happen to open
> +      # the fifo between the time a child outputs a token and it exits.
> +      until read at_token; do :; done <&AT_JOB_FIFO_FD

Hmm - IIUC, the '|| break' that you are deleting is there in case
something kills off the child and it never gets around to writing a
token, at which point we've now put the parent into an inf-loop waiting
for a token that will never arrive.  Are we sure we want to do this?

-- 
Eric Blake   ebl...@redhat.com    +1-801-349-2682
Libvirt virtualization library http://libvirt.org

Attachment: signature.asc
Description: OpenPGP digital signature

Reply via email to