summaryrefslogtreecommitdiff
path: root/src/libsystemd-bus/test-bus-chat.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/libsystemd-bus/test-bus-chat.c')
-rw-r--r--src/libsystemd-bus/test-bus-chat.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/libsystemd-bus/test-bus-chat.c b/src/libsystemd-bus/test-bus-chat.c
index 5f533cc6d0..24a194327e 100644
--- a/src/libsystemd-bus/test-bus-chat.c
+++ b/src/libsystemd-bus/test-bus-chat.c
@@ -35,6 +35,7 @@ static int server_init(sd_bus **_bus) {
sd_bus *bus = NULL;
sd_id128_t id;
int r;
+ const char *unique;
assert(_bus);
@@ -50,9 +51,15 @@ static int server_init(sd_bus **_bus) {
goto fail;
}
+ r = sd_bus_get_unique_name(bus, &unique);
+ if (r < 0) {
+ log_error("Failed to get unique name: %s", strerror(-r));
+ goto fail;
+ }
+
log_info("Peer ID is " SD_ID128_FORMAT_STR ".", SD_ID128_FORMAT_VAL(id));
+ log_info("Unique ID: %s", unique);
log_info("Can send file handles: %i", sd_bus_can_send(bus, 'h'));
- log_info("Unique ID: %s", strna(sd_bus_get_unique_name(bus)));
r = sd_bus_request_name(bus, "org.freedesktop.systemd.test", 0);
if (r < 0) {