summaryrefslogtreecommitdiff
path: root/src/libsystemd/sd-bus/bus-kernel.c
diff options
context:
space:
mode:
authorDavid Herrmann <dh.herrmann@gmail.com>2014-12-12 14:02:05 +0100
committerDavid Herrmann <dh.herrmann@gmail.com>2014-12-12 14:02:05 +0100
commit18ee085c155dcd5f196f2ef9b712698dfd377f82 (patch)
tree551a5290c08cf48cbefbc5db940b61937545ab1d /src/libsystemd/sd-bus/bus-kernel.c
parentec16945ebfe64d5cd5403ae1a1b16bc05a779a16 (diff)
bus: fix assert() on HELLO error-path
Make sure we don't call into any bus_kernel_*() functions before b->is_kernel is set to true. Hard-code the CMD_FREE just like the other helpers do.
Diffstat (limited to 'src/libsystemd/sd-bus/bus-kernel.c')
-rw-r--r--src/libsystemd/sd-bus/bus-kernel.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/libsystemd/sd-bus/bus-kernel.c b/src/libsystemd/sd-bus/bus-kernel.c
index 112292735b..d910d8e492 100644
--- a/src/libsystemd/sd-bus/bus-kernel.c
+++ b/src/libsystemd/sd-bus/bus-kernel.c
@@ -815,6 +815,10 @@ fail:
}
int bus_kernel_take_fd(sd_bus *b) {
+ struct kdbus_cmd_free cmd_free = {
+ .size = sizeof(cmd_free),
+ .flags = 0,
+ };
struct kdbus_bloom_parameter *bloom = NULL;
struct kdbus_cmd_hello *hello;
struct kdbus_item_list *items;
@@ -982,7 +986,8 @@ int bus_kernel_take_fd(sd_bus *b) {
return bus_start_running(b);
fail:
- (void) bus_kernel_cmd_free(b, hello->offset);
+ cmd_free.offset = hello->offset;
+ (void) ioctl(b->input_fd, KDBUS_CMD_FREE, &cmd_free);
return r;
}