summaryrefslogtreecommitdiff
path: root/src/automount.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/automount.c
parent2105e76a7725d6a29ebfe0af0bf23b3279e466a2 (diff)
dbus: make errors reported via D-Bus more useful
Diffstat (limited to 'src/automount.c')
-rw-r--r--src/automount.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/automount.c b/src/automount.c
index 0689ec7789..39eb3dd01a 100644
--- a/src/automount.c
+++ b/src/automount.c
@@ -35,6 +35,7 @@
#include "load-dropin.h"
#include "unit-name.h"
#include "dbus-automount.h"
+#include "bus-errors.h"
static const UnitActiveState state_translation_table[_AUTOMOUNT_STATE_MAX] = {
[AUTOMOUNT_DEAD] = UNIT_INACTIVE,
@@ -533,10 +534,13 @@ fail:
static void automount_enter_runnning(Automount *a) {
int r;
struct stat st;
+ DBusError error;
assert(a);
assert(a->mount);
+ dbus_error_init(&error);
+
mkdir_p(a->where, a->directory_mode);
/* Before we do anything, let's see if somebody is playing games with us? */
@@ -547,8 +551,8 @@ static void automount_enter_runnning(Automount *a) {
if (!S_ISDIR(st.st_mode) || st.st_dev != a->dev_id)
log_info("%s's automount point already active?", a->meta.id);
- else if ((r = manager_add_job(a->meta.manager, JOB_START, UNIT(a->mount), JOB_REPLACE, true, NULL)) < 0) {
- log_warning("%s failed to queue mount startup job: %s", a->meta.id, strerror(-r));
+ else if ((r = manager_add_job(a->meta.manager, JOB_START, UNIT(a->mount), JOB_REPLACE, true, &error, NULL)) < 0) {
+ log_warning("%s failed to queue mount startup job: %s", a->meta.id, bus_error(&error, r));
goto fail;
}
@@ -557,6 +561,7 @@ static void automount_enter_runnning(Automount *a) {
fail:
automount_enter_dead(a, false);
+ dbus_error_free(&error);
}
static int automount_start(Unit *u) {