Chris Green <[EMAIL PROTECTED]> typed:
:On Sat, Jul 21, 2001 at 07:47:21AM +0000, Geoff Wing wrote:
:>     switch(fork()) {
:>     default: /* parent must do this bit */
:>      execl("/usr/bin/telnet", "telnet", "192.168.1.1", NULL);

::-)   That works for me too (except that I had to add an include of
:termios.h).  What I don't understand is why my version didn't work, I
:think there must be some subtlety of how the child/parent intereacts
:as mine wasn't exactly the same as yours on that front.

Sorry, the above comment isn't random.  A more verbose description:
rxvt is waiting on a SIGCHLD/SIGCLD (well, it doesn't know about the
alternative SIGCLD name but...) which is sent when a child process exits.

In the mini-program I sent, the long term process (which became telnet)
was the immediate child of rxvt and the short term process (password sender)
was the child of that.  When the password sender process finished,
it sent a CHLD signal to the telnet process (which doesn't handle
it so ignores it).

If had you put the fork handling the other way around, the password
sender process would be sending a CHLD signal to rxvt which would
cause rxvt to exit.  Unless, of course, you messed about with signal
handling in there yourself.

Regards,
-- 
Geoff Wing : <[EMAIL PROTECTED]>
Rxvt Stuff : <[EMAIL PROTECTED]>
Zsh Stuff  : <[EMAIL PROTECTED]>

Reply via email to