summaryrefslogtreecommitdiff
path: root/src/path.c
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2010-07-08 02:43:18 +0200
committerLennart Poettering <lennart@poettering.net>2010-07-08 02:43:18 +0200
commit398ef8ba0266cca453d90a90b3a2aa1caa44189f (patch)
treec2724108ae05922768b1f57acc0372bb58d955cb /src/path.c
parent2105e76a7725d6a29ebfe0af0bf23b3279e466a2 (diff)
dbus: make errors reported via D-Bus more useful
Diffstat (limited to 'src/path.c')
-rw-r--r--src/path.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/path.c b/src/path.c
index 30d946d788..27c4544729 100644
--- a/src/path.c
+++ b/src/path.c
@@ -30,6 +30,7 @@
#include "path.h"
#include "dbus-path.h"
#include "special.h"
+#include "bus-errors.h"
static const UnitActiveState state_translation_table[_PATH_STATE_MAX] = {
[PATH_DEAD] = UNIT_INACTIVE,
@@ -298,17 +299,22 @@ static void path_enter_dead(Path *p, bool success) {
static void path_enter_running(Path *p) {
int r;
+ DBusError error;
+
assert(p);
+ dbus_error_init(&error);
- if ((r = manager_add_job(p->meta.manager, JOB_START, p->unit, JOB_REPLACE, true, NULL)) < 0)
+ if ((r = manager_add_job(p->meta.manager, JOB_START, p->unit, JOB_REPLACE, true, &error, NULL)) < 0)
goto fail;
path_set_state(p, PATH_RUNNING);
return;
fail:
- log_warning("%s failed to queue unit startup job: %s", p->meta.id, strerror(-r));
+ log_warning("%s failed to queue unit startup job: %s", p->meta.id, bus_error(&error, r));
path_enter_dead(p, false);
+
+ dbus_error_free(&error);
}