ex doesn't wait for all its children

thorinn at diku.UUCP thorinn at diku.UUCP
Tue Jan 20 01:53:53 AEST 1987


In article <10069 at tektronix.TEK.COM> tonyb at tektronix.TEK.COM (Tony Birnseth) writes:
>	The only change that was really necessary was to add a call 
>	to waitfor() after the call to setrupt() if forking to write the 'io' 
>	stream.

>	Of course it's entirely possible that I'm missing something here.  I 
>	think the fix should be done correctly by waiting for each child after
>	it is created.
>
  I think that you missed one important point: If the region written to the
pipe contains more than 4K bytes, the first child won't exit if no one reads
the pipe. So the correct thing would be to remember the pid of the writer and
wait for it *after* the reader exits -- even if the writer didn't get every-
thing into the pipe, it will get a SIGPIPE and die when the pipe is closed.
--
Lars Mathiesen, DIKU, U of Copenhagen, Denmark		..mcvax!diku!thorinn
Institute of Datalogy -- we're scientists, not engineers.



More information about the Comp.unix.wizards mailing list