Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!uunet!xrxedds!liebman From: liebman@xrxedds.UUCP (Chris Liebman) Newsgroups: comp.windows.x Subject: Re: Exec/Fork/Stdout (Eek! Help!) Message-ID: <684@alpo.UUCP> Date: 31 Jul 90 10:53:05 GMT References: <7890@ucrmath.ucr.edu> <5211@harrier.ukc.ac.uk> Sender: news@xrxedds.UUCP Reply-To: liebman.Herndon@Xerox.Com Organization: EDDS, Xerox Corporation, Leesburg Va. Lines: 30 |> |> When the child dies you can only really safely set a flag which is checked |> in the pipe "processing_routine" (this routine will still be called |> when the pipe is closed on the child's end .. and all your reads will |> return 0); thus when this flag is set and the read on the pipe returns 0 |> you have read all the data from the child and reached EOF. You should |> then remove this extra event source using XtRemoveInput() and don't forget to I think that there is a race condition here. How do you know that you will see the SIGCHLD first? Instead of checking the SIGCHLD flag in the pipe "processing_routine" I used my own maon loop and checked wwhen the next event comes in. The only side effect is that the pipe hangs arround a little longer. |> Richard Hesketh : @nsfnet-relay.ac.uk:rlh2@ukc.ac.uk |> : rlh2@ukc.ac.uk ..!mcsun!ukc!rlh2 |> --- |> Computing Lab., University of Kent at Canterbury, |> Canterbury, Kent, CT2 7NF, United Kingdom. Tel: +44 227 764000 ext 7620/3682 Chris Liebman UUCP: ...!uunet!xrxedds!liebman ARPA: liebman.Herndon@Xerox.Com liebman@arisia.xerox.com ATT: 1-(703)-787-2032 XNS: liebman:Herndon:xerox INTELNET: 8*440-2032