summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarcel Holtmann <marcel@holtmann.org>2007-01-25 15:41:51 +0000
committerMarcel Holtmann <marcel@holtmann.org>2007-01-25 15:41:51 +0000
commit043f69e29d486f11c394d0e616779d2904b56fe8 (patch)
treee897a6e40462101993fb1b6eab20468f5cfa3714
parent1f1bd7f99b9e9e87f3fca0499154d0959f089dea (diff)
Check for PID before sending SIGKILL
-rw-r--r--hcid/dbus-service.c4
1 files 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);