=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/rlogin/Attic/rlogin.c,v retrieving revision 1.25 retrieving revision 1.26 diff -c -r1.25 -r1.26 *** src/usr.bin/rlogin/Attic/rlogin.c 2001/10/02 01:14:55 1.25 --- src/usr.bin/rlogin/Attic/rlogin.c 2001/11/16 23:57:12 1.26 *************** *** 1,4 **** ! /* $OpenBSD: rlogin.c,v 1.25 2001/10/02 01:14:55 art Exp $ */ /* $NetBSD: rlogin.c,v 1.8 1995/10/05 09:07:22 mycroft Exp $ */ /* --- 1,4 ---- ! /* $OpenBSD: rlogin.c,v 1.26 2001/11/16 23:57:12 deraadt Exp $ */ /* $NetBSD: rlogin.c,v 1.8 1995/10/05 09:07:22 mycroft Exp $ */ /* *************** *** 44,50 **** #if 0 static char sccsid[] = "@(#)rlogin.c 8.1 (Berkeley) 6/6/93"; #else ! static char rcsid[] = "$OpenBSD: rlogin.c,v 1.25 2001/10/02 01:14:55 art Exp $"; #endif #endif /* not lint */ --- 44,50 ---- #if 0 static char sccsid[] = "@(#)rlogin.c 8.1 (Berkeley) 6/6/93"; #else ! static char rcsid[] = "$OpenBSD: rlogin.c,v 1.26 2001/11/16 23:57:12 deraadt Exp $"; #endif #endif /* not lint */ *************** *** 130,135 **** --- 130,136 ---- void copytochild __P((int)); __dead void doit __P((sigset_t *)); __dead void done __P((int)); + __dead void sig_done __P((int)); void echo __P((char)); u_int getescape __P((char *)); void lostpeer __P((int)); *************** *** 462,467 **** --- 463,485 ---- exit(status); } + __dead void + sig_done(status) + int status; + { + int w, wstatus; + + mode(0); + if (child > 0) { + /* make sure catch_child does not snap it up */ + (void)signal(SIGCHLD, SIG_DFL); + if (kill(child, SIGKILL) >= 0) + while ((w = wait(&wstatus)) > 0 && w != child) + ; + } + _exit(status); + } + int dosigwinch; /* *************** *** 495,502 **** if (pid == child && !WIFSTOPPED(status)) { child = -1; if (WIFEXITED(status)) ! done(WEXITSTATUS(status)); ! done(WTERMSIG(status)); } } errno = save_errno; --- 513,520 ---- if (pid == child && !WIFSTOPPED(status)) { child = -1; if (WIFEXITED(status)) ! sig_done(WEXITSTATUS(status)); ! sig_done(WTERMSIG(status)); } } errno = save_errno;