"Tony Hoyle" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]...
> On Mon, 17 Jun 2002 14:52:18 +0000 (UTC), "Anthony Williams"
> <[EMAIL PROTECTED]> wrote:
>
> >The new version works OK with both gnuclient and vi. Thanks.
> >
> The biggest problem is run_popen which can't use waitpid as its
> listener is in a child process (Unix only lets you wait for your own
> children, which I suppose make some sense).  I think the way I've done
> it now works but it'll need some testing.


You could move the run_command into the child that does the monitoring (so
the execed process is now a grandchild of the original cvs), but then you
would have to do the pipes before the first fork, so the original cvs can
talk to the grandchild process. Messy, but at least you can then monitor the
grandchild properly. You've still got the issue of trapping errors, though.

Anyway, since we only really care about i/o for the target of a popen, and
not whether or not it has finished, your current code looks OK --- if the
output streams are closed at the target end, stop reading them. If the
target is still running, who cares? When we're finished writing to it, we'll
close our end of its stdin. If it then sits around for 3 days chewing the
cud, it doesn't matter.

Anthony
--
Anthony Williams
Software Engineer, Nortel Networks Optical Components Ltd
The opinions expressed in this message are not necessarily those of my
employer




_______________________________________________
Cvsnt mailing list
[EMAIL PROTECTED]
http://www.cvsnt.org/cgi-bin/mailman/listinfo/cvsnt

Reply via email to