busctl: make sure --address connects as bus-client
authorDavid Herrmann <dh.herrmann@gmail.com>
Fri, 31 Jul 2015 17:58:19 +0000 (19:58 +0200)
committerDavid Herrmann <dh.herrmann@gmail.com>
Fri, 31 Jul 2015 18:00:21 +0000 (20:00 +0200)
There is really no reason to use `busctl` to connect to legacy private
bus endpoints. Fix this and make sure `busctl --address=unix:path=/foo`
works!

src/libsystemd/sd-bus/busctl.c

index 6aaaf0e..017a0d8 100644 (file)
@@ -2018,15 +2018,15 @@ int main(int argc, char *argv[]) {
                 }
         }
 
+        r = sd_bus_set_bus_client(bus, true);
+        if (r < 0) {
+                log_error_errno(r, "Failed to set bus client: %m");
+                goto finish;
+        }
+
         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_errno(r, "Failed to set bus client: %m");
-                        goto finish;
-                }
-
                 switch (arg_transport) {
 
                 case BUS_TRANSPORT_LOCAL: