From 1ef7027ba64b447255f494c13c9677babe364254 Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Thu, 25 Jan 2007 15:45:36 +0000 Subject: Move debug output into condition --- hcid/dbus-service.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/hcid/dbus-service.c b/hcid/dbus-service.c index 213dd279..5dda35a9 100644 --- a/hcid/dbus-service.c +++ b/hcid/dbus-service.c @@ -308,12 +308,14 @@ static gboolean service_shutdown_timeout(gpointer data) { struct service *service = data; - debug("Sending SIGKILL to \"%s\" (PID %d) since it didn't exit yet", + if (service->pid > 0) { + debug("SIGKILL for \"%s\" (PID %d) since it didn't exit yet", service->name, service->pid); - if (service->pid > 0 && kill(service->pid, SIGKILL) < 0) - error("kill(%d, SIGKILL): %s (%d)", service->pid, - strerror(errno), errno); + if (kill(service->pid, SIGKILL) < 0) + error("kill(%d, SIGKILL): %s (%d)", service->pid, + strerror(errno), errno); + } service->shutdown_timer = 0; -- cgit