summaryrefslogtreecommitdiff
path: root/usr.bin/tip/tipout.c
diff options
context:
space:
mode:
authorTheo de Raadt <deraadt@cvs.openbsd.org>2004-05-26 18:18:00 +0000
committerTheo de Raadt <deraadt@cvs.openbsd.org>2004-05-26 18:18:00 +0000
commitff29469fca330b41980c40fcad9f5fdaeba68bd9 (patch)
tree6a4f0d0869669b2df6fb8153171803908e2a458c /usr.bin/tip/tipout.c
parent4f22c400434365c1af3c92ce2e09b772225c198d (diff)
if one process is killed, kill the other ourself; various ok
Diffstat (limited to 'usr.bin/tip/tipout.c')
-rw-r--r--usr.bin/tip/tipout.c10
1 files changed, 6 insertions, 4 deletions
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;