From 043f69e29d486f11c394d0e616779d2904b56fe8 Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Thu, 25 Jan 2007 15:41:51 +0000 Subject: Check for PID before sending SIGKILL --- hcid/dbus-service.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/hcid/dbus-service.c b/hcid/dbus-service.c index d60cc6f8..a8fb13ed 100644 --- a/hcid/dbus-service.c +++ b/hcid/dbus-service.c @@ -271,7 +271,7 @@ static void abort_startup(struct service *service, DBusConnection *conn, int eco service->action = NULL; } - if (service->pid && kill(service->pid, SIGKILL) < 0) + if (service->pid > 0 && kill(service->pid, SIGKILL) < 0) error("kill(%d, SIGKILL): %s (%d)", service->pid, strerror(errno), errno); } @@ -311,7 +311,7 @@ static gboolean service_shutdown_timeout(gpointer data) debug("Sending SIGKILL to \"%s\" (PID %d) since it didn't exit yet", service->name, service->pid); - if (kill(service->pid, SIGKILL) < 0) + if (service->pid > 0 && kill(service->pid, SIGKILL) < 0) error("kill(%d, SIGKILL): %s (%d)", service->pid, strerror(errno), errno); -- cgit