chiark / gitweb /
systemctl: properly detect whether taling to systemd via D-Bus worked before falling...
authorLennart Poettering <lennart@poettering.net>
Fri, 13 Aug 2010 02:53:00 +0000 (04:53 +0200)
committerLennart Poettering <lennart@poettering.net>
Fri, 13 Aug 2010 02:53:33 +0000 (04:53 +0200)
src/systemctl.c

index 6d17649a7f976e3eb91a958b112ffd221335b81b..2e7a6a8c5c023376d20bc9d4dd9f0941fcbead03 100644 (file)
@@ -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.");