summaryrefslogtreecommitdiff
path: root/src/libsystemd-bus/bus-kernel.c
diff options
context:
space:
mode:
authorDaniel Mack <zonque@gmail.com>2013-11-29 16:24:40 +0100
committerDaniel Mack <zonque@gmail.com>2013-11-29 16:27:30 +0100
commitc58dea190c4cc66330942ccb7a9d485ff45504d3 (patch)
tree2e408f7b0a150ec2ff1d066cbe9c5a728ea8523a /src/libsystemd-bus/bus-kernel.c
parentd21a7bb1a91ca4654287a69d0443629198e42e1b (diff)
libsystemd-bus: copy over kdbus provided 128-bit bus id
kdbus now copies the bus unique id back to userspace in the hello ioctl(). Use these bytes to set the server id of the sd_bus.
Diffstat (limited to 'src/libsystemd-bus/bus-kernel.c')
-rw-r--r--src/libsystemd-bus/bus-kernel.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/libsystemd-bus/bus-kernel.c b/src/libsystemd-bus/bus-kernel.c
index 959392a62d..d2fcfd7f92 100644
--- a/src/libsystemd-bus/bus-kernel.c
+++ b/src/libsystemd-bus/bus-kernel.c
@@ -357,6 +357,9 @@ int bus_kernel_take_fd(sd_bus *b) {
b->bus_client = true;
b->can_fds = !!(hello.conn_flags & KDBUS_HELLO_ACCEPT_FD);
+ /* the kernel told us the UUID of the underlying bus */
+ memcpy(b->server_id.bytes, hello.id128, sizeof(b->server_id.bytes));
+
r = bus_start_running(b);
if (r < 0)
return r;