From cb7aee3c6c58e2f4763925b92a6a08191b4d80a0 Mon Sep 17 00:00:00 2001 From: Simon McVittie Date: Tue, 14 Oct 2014 15:37:33 +0100 Subject: [PATCH] dbus-daemon-launch-helper: on failure, log it to system log before exiting The communication channel between the launch helper and the dbus-daemon is rather limited, so any extra hints are welcome. --- bus/activation-helper-bin.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/bus/activation-helper-bin.c b/bus/activation-helper-bin.c index f5f16d2..d8cb69c 100644 --- a/bus/activation-helper-bin.c +++ b/bus/activation-helper-bin.c @@ -32,9 +32,14 @@ #include #include +#include + static int convert_error_to_exit_code (DBusError *error) { + _dbus_system_log (DBUS_SYSTEM_LOG_SECURITY, "%s: %s", error->name, + error->message); + if (dbus_error_has_name (error, DBUS_ERROR_NO_MEMORY)) return BUS_SPAWN_EXIT_CODE_NO_MEMORY; @@ -66,7 +71,6 @@ convert_error_to_exit_code (DBusError *error) return BUS_SPAWN_EXIT_CODE_CHILD_SIGNALED; /* should we assert? */ - fprintf(stderr, "%s: %s\n", error->name, error->message); return BUS_SPAWN_EXIT_CODE_GENERIC_FAILURE; } @@ -77,6 +81,8 @@ main (int argc, char **argv) DBusError error; int retval; + _dbus_init_system_log (FALSE); + /* default is all okay */ retval = 0; -- 2.1.1