X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=blobdiff_plain;f=src%2Ftimer.c;h=1c7010d120829ddada9accf9c5bb217228e8ec42;hb=dce3acd2e2447a9de642768f86e39d7c9d5bee81;hp=b4521e6efc9b5acd57648e2912dfdbeffcd40732;hpb=03fae01822b5275a2940458f65644796283a8a23;p=elogind.git diff --git a/src/timer.c b/src/timer.c index b4521e6ef..1c7010d12 100644 --- a/src/timer.c +++ b/src/timer.c @@ -26,6 +26,7 @@ #include "timer.h" #include "dbus-timer.h" #include "special.h" +#include "bus-errors.h" static const UnitActiveState state_translation_table[_TIMER_STATE_MAX] = { [TIMER_DEAD] = UNIT_INACTIVE, @@ -261,18 +262,23 @@ fail: } static void timer_enter_running(Timer *t) { + DBusError error; int r; + assert(t); + dbus_error_init(&error); - if ((r = manager_add_job(t->meta.manager, JOB_START, t->unit, JOB_REPLACE, true, NULL)) < 0) + if ((r = manager_add_job(t->meta.manager, JOB_START, t->unit, JOB_REPLACE, true, &error, NULL)) < 0) goto fail; timer_set_state(t, TIMER_RUNNING); return; fail: - log_warning("%s failed to queue unit startup job: %s", t->meta.id, strerror(-r)); + log_warning("%s failed to queue unit startup job: %s", t->meta.id, bus_error(&error, r)); timer_enter_dead(t, false); + + dbus_error_free(&error); } static int timer_start(Unit *u) {