summaryrefslogtreecommitdiff
path: root/src/libsystemd/sd-bus/busctl.c
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2014-11-20 21:01:06 +0100
committerLennart Poettering <lennart@poettering.net>2014-11-21 00:32:02 +0100
commitb18ec7e29f9756bb66f63a0fa02a6ceb40b38b03 (patch)
treec7d2225a551cf920fbac8c748ba90c17964cf973 /src/libsystemd/sd-bus/busctl.c
parent79f34de9fb8e4faa6ed0847b386099a4ba100a8a (diff)
busctl: when --address is specified do not assume we connect to a full bus
Diffstat (limited to 'src/libsystemd/sd-bus/busctl.c')
-rw-r--r--src/libsystemd/sd-bus/busctl.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/libsystemd/sd-bus/busctl.c b/src/libsystemd/sd-bus/busctl.c
index 4da8074375..809940a2d5 100644
--- a/src/libsystemd/sd-bus/busctl.c
+++ b/src/libsystemd/sd-bus/busctl.c
@@ -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));