summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarcel Holtmann <marcel@holtmann.org>2007-01-25 15:42:38 +0000
committerMarcel Holtmann <marcel@holtmann.org>2007-01-25 15:42:38 +0000
commit92261164bbe863141b88817eaaec2e79b3df7a90 (patch)
tree9eaa73c6ace2b458519273d7383eafffe91f236b
parent043f69e29d486f11c394d0e616779d2904b56fe8 (diff)
Check for PID before sending SIGTERM
-rw-r--r--hcid/dbus-service.c2
1 files changed, 1 insertions, 1 deletions
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);