chiark / gitweb /
busctl: when --address is specified do not assume we connect to a full bus
authorLennart Poettering <lennart@poettering.net>
Thu, 20 Nov 2014 20:01:06 +0000 (21:01 +0100)
committerLennart Poettering <lennart@poettering.net>
Thu, 20 Nov 2014 23:32:02 +0000 (00:32 +0100)
src/libsystemd/sd-bus/busctl.c

index 4da8074..809940a 100644 (file)
@@ -1612,6 +1612,12 @@ int main(int argc, char *argv[]) {
         if (arg_address)
                 r = sd_bus_set_address(bus, arg_address);
         else {
+                r = sd_bus_set_bus_client(bus, true);
+                if (r < 0) {
+                        log_error("Failed to set bus client: %s", strerror(-r));
+                        goto finish;
+                }
+
                 switch (arg_transport) {
 
                 case BUS_TRANSPORT_LOCAL:
@@ -1638,12 +1644,6 @@ int main(int argc, char *argv[]) {
                 goto finish;
         }
 
-        r = sd_bus_set_bus_client(bus, true);
-        if (r < 0) {
-                log_error("Failed to set bus client: %s", strerror(-r));
-                goto finish;
-        }
-
         r = sd_bus_start(bus);
         if (r < 0) {
                 log_error("Failed to connect to bus: %s", strerror(-r));