summaryrefslogtreecommitdiff
path: root/src/libsystemd
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2014-11-28 16:38:47 +0100
committerLennart Poettering <lennart@poettering.net>2014-11-28 20:29:43 +0100
commit5c3026927de9dfa60ad6ae8326fef5d7824e723e (patch)
tree6e31a4fea775b3eb5f1afa5cfe484cef97fc9820 /src/libsystemd
parent4a62c710b62a5a3c7a8a278b810b9d5b5a0c8f4f (diff)
sd-bus: rename sd_bus_get_owner_id() → sd_bus_get_bus_id()
The ID returned really doesn't identify the owner, but the bus instance, hence fix this misnaming. Also, update "busctl status" to show the ID in its output.
Diffstat (limited to 'src/libsystemd')
-rw-r--r--src/libsystemd/libsystemd.sym.m42
-rw-r--r--src/libsystemd/sd-bus/busctl.c5
-rw-r--r--src/libsystemd/sd-bus/sd-bus.c2
-rw-r--r--src/libsystemd/sd-bus/test-bus-chat.c2
4 files changed, 8 insertions, 3 deletions
diff --git a/src/libsystemd/libsystemd.sym.m4 b/src/libsystemd/libsystemd.sym.m4
index 7632942564..baa1a6f585 100644
--- a/src/libsystemd/libsystemd.sym.m4
+++ b/src/libsystemd/libsystemd.sym.m4
@@ -190,7 +190,7 @@ global:
sd_bus_unref;
sd_bus_is_open;
sd_bus_can_send;
- sd_bus_get_owner_id;
+ sd_bus_get_bus_id;
sd_bus_get_owner_creds;
sd_bus_get_description;
sd_bus_send;
diff --git a/src/libsystemd/sd-bus/busctl.c b/src/libsystemd/sd-bus/busctl.c
index 229a1cf9a2..f75a9dcbd3 100644
--- a/src/libsystemd/sd-bus/busctl.c
+++ b/src/libsystemd/sd-bus/busctl.c
@@ -1177,11 +1177,16 @@ static int status(sd_bus *bus, char *argv[]) {
_SD_BUS_CREDS_ALL);
} else {
const char *scope;
+ sd_id128_t bus_id;
r = sd_bus_get_scope(bus, &scope);
if (r >= 0)
printf("Scope=%s%s%s\n", ansi_highlight(), scope, ansi_highlight_off());
+ r = sd_bus_get_bus_id(bus, &bus_id);
+ if (r >= 0)
+ printf("BusID=%s" SD_ID128_FORMAT_STR "%s\n", ansi_highlight(), SD_ID128_FORMAT_VAL(bus_id), ansi_highlight_off());
+
r = sd_bus_get_owner_creds(
bus,
(arg_augment_creds ? SD_BUS_CREDS_AUGMENT : 0) | _SD_BUS_CREDS_ALL,
diff --git a/src/libsystemd/sd-bus/sd-bus.c b/src/libsystemd/sd-bus/sd-bus.c
index 70dabccf5d..5947cd72c9 100644
--- a/src/libsystemd/sd-bus/sd-bus.c
+++ b/src/libsystemd/sd-bus/sd-bus.c
@@ -1442,7 +1442,7 @@ _public_ int sd_bus_can_send(sd_bus *bus, char type) {
return bus_type_is_valid(type);
}
-_public_ int sd_bus_get_owner_id(sd_bus *bus, sd_id128_t *id) {
+_public_ int sd_bus_get_bus_id(sd_bus *bus, sd_id128_t *id) {
int r;
assert_return(bus, -EINVAL);
diff --git a/src/libsystemd/sd-bus/test-bus-chat.c b/src/libsystemd/sd-bus/test-bus-chat.c
index 4a025d69ea..06edd621e4 100644
--- a/src/libsystemd/sd-bus/test-bus-chat.c
+++ b/src/libsystemd/sd-bus/test-bus-chat.c
@@ -76,7 +76,7 @@ static int server_init(sd_bus **_bus) {
goto fail;
}
- r = sd_bus_get_owner_id(bus, &id);
+ r = sd_bus_get_bus_id(bus, &id);
if (r < 0) {
log_error_errno(r, "Failed to get server ID: %m");
goto fail;