diff options
author | Marcel Holtmann <marcel@holtmann.org> | 2007-01-25 15:41:51 +0000 |
---|---|---|
committer | Marcel Holtmann <marcel@holtmann.org> | 2007-01-25 15:41:51 +0000 |
commit | 043f69e29d486f11c394d0e616779d2904b56fe8 (patch) | |
tree | e897a6e40462101993fb1b6eab20468f5cfa3714 /hcid | |
parent | 1f1bd7f99b9e9e87f3fca0499154d0959f089dea (diff) |
Check for PID before sending SIGKILL
Diffstat (limited to 'hcid')
-rw-r--r-- | hcid/dbus-service.c | 4 |
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); |