From ff29469fca330b41980c40fcad9f5fdaeba68bd9 Mon Sep 17 00:00:00 2001 From: Theo de Raadt Date: Wed, 26 May 2004 18:18:00 +0000 Subject: if one process is killed, kill the other ourself; various ok --- usr.bin/tip/tipout.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'usr.bin/tip/tipout.c') diff --git a/usr.bin/tip/tipout.c b/usr.bin/tip/tipout.c index 57ca3e356ef..e84ec4113bb 100644 --- a/usr.bin/tip/tipout.c +++ b/usr.bin/tip/tipout.c @@ -1,4 +1,4 @@ -/* $OpenBSD: tipout.c,v 1.10 2003/06/03 02:56:18 millert Exp $ */ +/* $OpenBSD: tipout.c,v 1.11 2004/05/26 18:17:59 deraadt Exp $ */ /* $NetBSD: tipout.c,v 1.5 1996/12/29 10:34:12 cgd Exp $ */ /* @@ -34,7 +34,7 @@ #if 0 static char sccsid[] = "@(#)tipout.c 8.1 (Berkeley) 6/6/93"; #endif -static const char rcsid[] = "$OpenBSD: tipout.c,v 1.10 2003/06/03 02:56:18 millert Exp $"; +static const char rcsid[] = "$OpenBSD: tipout.c,v 1.11 2004/05/26 18:17:59 deraadt Exp $"; #endif /* not lint */ #include "tip.h" @@ -95,11 +95,13 @@ intEMT() } void -intTERM() +intTERM(int signo) { if (boolean(value(SCRIPT)) && fscript != NULL) fclose(fscript); + if (signo && tipin_pid) + kill(tipin_pid, signo); exit(0); } @@ -140,7 +142,7 @@ tipout() sigemptyset(&mask); sigaddset(&mask, SIGTERM); sigprocmask(SIG_BLOCK, &mask, NULL); - intTERM(); + intTERM(0); /*NOTREACHED*/ } continue; -- cgit v1.2.3