From b6078f290656feed8b6aaca7cc208a8c80f870fd Mon Sep 17 00:00:00 2001 From: Poul-Henning Kamp Date: Mon, 9 Oct 1995 09:51:17 +0000 Subject: [PATCH] We wouldn't want to kill init if our parent died... Spotted by: davidg --- usr.bin/tip/tip/tipout.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/usr.bin/tip/tip/tipout.c b/usr.bin/tip/tip/tipout.c index 4d6b56524c2..3464dd583b7 100644 --- a/usr.bin/tip/tip/tipout.c +++ b/usr.bin/tip/tip/tipout.c @@ -137,12 +137,14 @@ tipout() intTERM(); /*NOTREACHED*/ } else if (cnt == 0 && errno == ENOENT) { - kill(getppid(),SIGUSR1); + if (getppid() != 1) + kill(getppid(),SIGUSR1); sigblock(sigmask(SIGTERM)); intTERM(); /*NOTREACHED*/ } else if (cnt < 0) { - kill(getppid(),SIGUSR1); + if (getppid() != 1) + kill(getppid(),SIGUSR1); sigblock(sigmask(SIGTERM)); intTERM(); /*NOTREACHED*/