From 32b3eb094b5546c32d74d84ad181e40b611e1960 Mon Sep 17 00:00:00 2001 From: "Michael K. Johnson" Date: Thu, 23 Sep 1999 14:54:51 +0000 Subject: be more careful about killing --- src/ppp-watch.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/ppp-watch.c b/src/ppp-watch.c index dc0454ef..a0d708fc 100644 --- a/src/ppp-watch.c +++ b/src/ppp-watch.c @@ -450,6 +450,7 @@ main(int argc, char **argv) { if (physicalDevice) { free(physicalDevice); physicalDevice = NULL; } physicalDevice = pppLogicalToPhysical(&pppdPid, device); if (physicalDevice) { free(physicalDevice); physicalDevice = NULL; } + if (!pppdPid) cleanExit(34); kill(pppdPid, sendsig); if (sendsig == SIGKILL) { kill(-pppdPid, sendsig); @@ -501,7 +502,7 @@ main(int argc, char **argv) { * hold the modem if we do not get rid of them. * We have kept the old pid/pgrp around in pppdPid. */ - kill(-pppdPid, SIGKILL); + if (pppdPid) kill(-pppdPid, SIGKILL); pppdPid = 0; if (!WIFEXITED(status)) cleanExit(29); -- cgit v1.2.1