diff options
author | Johan Hedberg <johan.hedberg@nokia.com> | 2007-01-21 21:20:23 +0000 |
---|---|---|
committer | Johan Hedberg <johan.hedberg@nokia.com> | 2007-01-21 21:20:23 +0000 |
commit | e224857e7d7875ee9e2e306d4b8fafad94d2a967 (patch) | |
tree | d5af3f44cff22ef62cace6ccb36988561f7a1877 /hcid | |
parent | 0d7b614648f2170aa66c799e0f3a4ea62a59c9d9 (diff) |
More accurate service exit reason debug messages
Diffstat (limited to 'hcid')
-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; |