diff options
-rw-r--r-- | hcid/dbus-service.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/hcid/dbus-service.c b/hcid/dbus-service.c index a9532a3b..30456591 100644 --- a/hcid/dbus-service.c +++ b/hcid/dbus-service.c @@ -32,6 +32,7 @@ #include <dirent.h> #include <signal.h> #include <sys/types.h> +#include <sys/wait.h> #include <glib.h> @@ -279,8 +280,12 @@ static void service_died(GPid pid, gint status, gpointer data) { struct service *service = data; - debug("%s (%s) exited with status %d", service->name, - service->ident, status); + if (WIFEXITED(status)) + debug("%s (%s) exited with status %d", service->name, + service->ident, WEXITSTATUS(status)); + else + debug("%s (%s) was killed by signal %d", service->name, + service->ident, WTERMSIG(status)); g_spawn_close_pid(pid); service->pid = 0; |