summaryrefslogtreecommitdiff
path: root/src/libsystemd/sd-bus/busctl.c
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2014-11-28 16:51:45 +0100
committerLennart Poettering <lennart@poettering.net>2014-11-28 20:29:43 +0100
commit5b820358cf2a5cb6d67cc0b1faaaca3b0171f1ac (patch)
tree91e4d6c1bbe2586c725b4de8d4308c5d6e0256a9 /src/libsystemd/sd-bus/busctl.c
parent5c3026927de9dfa60ad6ae8326fef5d7824e723e (diff)
sd-bus: add new sd_bus_get_address() for querying the current bus address
Also, update "busctl" to show this in its output.
Diffstat (limited to 'src/libsystemd/sd-bus/busctl.c')
-rw-r--r--src/libsystemd/sd-bus/busctl.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/libsystemd/sd-bus/busctl.c b/src/libsystemd/sd-bus/busctl.c
index f75a9dcbd3..1ba4e8adac 100644
--- a/src/libsystemd/sd-bus/busctl.c
+++ b/src/libsystemd/sd-bus/busctl.c
@@ -1176,12 +1176,16 @@ static int status(sd_bus *bus, char *argv[]) {
pid,
_SD_BUS_CREDS_ALL);
} else {
- const char *scope;
+ const char *scope, *address;
sd_id128_t bus_id;
+ r = sd_bus_get_address(bus, &address);
+ if (r >= 0)
+ printf("BusAddress=%s%s%s\n", ansi_highlight(), address, ansi_highlight_off());
+
r = sd_bus_get_scope(bus, &scope);
if (r >= 0)
- printf("Scope=%s%s%s\n", ansi_highlight(), scope, ansi_highlight_off());
+ printf("BusScope=%s%s%s\n", ansi_highlight(), scope, ansi_highlight_off());
r = sd_bus_get_bus_id(bus, &bus_id);
if (r >= 0)