From 92261164bbe863141b88817eaaec2e79b3df7a90 Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Thu, 25 Jan 2007 15:42:38 +0000 Subject: Check for PID before sending SIGTERM --- hcid/dbus-service.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hcid/dbus-service.c b/hcid/dbus-service.c index a8fb13ed..213dd279 100644 --- a/hcid/dbus-service.c +++ b/hcid/dbus-service.c @@ -322,7 +322,7 @@ static gboolean service_shutdown_timeout(gpointer data) static void stop_service(struct service *service, gboolean remove) { - if (kill(service->pid, SIGTERM) < 0) + if (service->pid > 0 && kill(service->pid, SIGTERM) < 0) error("kill(%d, SIGTERM): %s (%d)", service->pid, strerror(errno), errno); -- cgit