summaryrefslogtreecommitdiff
path: root/src/main.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/main.c')
-rw-r--r--src/main.c20
1 files changed, 14 insertions, 6 deletions
diff --git a/src/main.c b/src/main.c
index d5902b354f..3124b7644e 100644
--- a/src/main.c
+++ b/src/main.c
@@ -43,6 +43,7 @@
#include "fdset.h"
#include "special.h"
#include "conf-parser.h"
+#include "bus-errors.h"
static enum {
ACTION_RUN,
@@ -963,14 +964,20 @@ int main(int argc, char *argv[]) {
fclose(serialization);
serialization = NULL;
} else {
+ DBusError error;
+
+ dbus_error_init(&error);
+
log_debug("Activating default unit: %s", arg_default_unit);
- if ((r = manager_load_unit(m, arg_default_unit, NULL, &target)) < 0) {
- log_error("Failed to load default target: %s", strerror(-r));
+ if ((r = manager_load_unit(m, arg_default_unit, NULL, &error, &target)) < 0) {
+ log_error("Failed to load default target: %s", bus_error(&error, r));
+ dbus_error_free(&error);
log_info("Trying to load rescue target...");
- if ((r = manager_load_unit(m, SPECIAL_RESCUE_TARGET, NULL, &target)) < 0) {
- log_error("Failed to load rescue target: %s", strerror(-r));
+ if ((r = manager_load_unit(m, SPECIAL_RESCUE_TARGET, NULL, &error, &target)) < 0) {
+ log_error("Failed to load rescue target: %s", bus_error(&error, r));
+ dbus_error_free(&error);
goto finish;
}
}
@@ -980,8 +987,9 @@ int main(int argc, char *argv[]) {
manager_dump_units(m, stdout, "\t");
}
- if ((r = manager_add_job(m, JOB_START, target, JOB_REPLACE, false, &job)) < 0) {
- log_error("Failed to start default target: %s", strerror(-r));
+ if ((r = manager_add_job(m, JOB_START, target, JOB_REPLACE, false, &error, &job)) < 0) {
+ log_error("Failed to start default target: %s", bus_error(&error, r));
+ dbus_error_free(&error);
goto finish;
}