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.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/libsystemd-bus/test-bus-chat.c b/src/libsystemd-bus/test-bus-chat.c
index d8677cc9e8..5f533cc6d0 100644
--- a/src/libsystemd-bus/test-bus-chat.c
+++ b/src/libsystemd-bus/test-bus-chat.c
@@ -33,6 +33,7 @@
static int server_init(sd_bus **_bus) {
sd_bus *bus = NULL;
+ sd_id128_t id;
int r;
assert(_bus);
@@ -43,6 +44,16 @@ static int server_init(sd_bus **_bus) {
goto fail;
}
+ r = sd_bus_get_peer(bus, &id);
+ if (r < 0) {
+ log_error("Failed to get peer ID: %s", strerror(-r));
+ goto fail;
+ }
+
+ log_info("Peer ID is " SD_ID128_FORMAT_STR ".", SD_ID128_FORMAT_VAL(id));
+ 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) {
log_error("Failed to acquire name: %s", strerror(-r));