summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2010-08-13 04:53:00 +0200
committerLennart Poettering <lennart@poettering.net>2010-08-13 04:53:33 +0200
commitfbc43921be7ed06112897d55e4d0b7ab986edc07 (patch)
tree7e870889c754b8fc7326996c8991d217cd1c8617
parent0278dfeb30a1d1022501f5671c548283d7ee9387 (diff)
systemctl: properly detect whether taling to systemd via D-Bus worked before falling back to upstart/initctl
-rw-r--r--src/systemctl.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/systemctl.c b/src/systemctl.c
index 6d17649a7f..2e7a6a8c5c 100644
--- a/src/systemctl.c
+++ b/src/systemctl.c
@@ -1171,7 +1171,10 @@ static int start_unit(DBusConnection *bus, char **args, unsigned n) {
}
if (!arg_no_block)
- r = wait_for_jobs(bus, s);
+ if ((r = wait_for_jobs(bus, s)) < 0)
+ goto finish;
+
+ r = 1;
finish:
if (s)
@@ -4599,7 +4602,7 @@ static int start_with_fallback(DBusConnection *bus) {
/* Nothing else worked, so let's try
* /dev/initctl */
- if (talk_initctl() != 0)
+ if (talk_initctl() > 0)
goto done;
log_error("Failed to talk to init daemon.");