diff options
author | Daniel Mack <daniel@zonque.org> | 2014-10-21 19:19:44 +0200 |
---|---|---|
committer | Daniel Mack <daniel@zonque.org> | 2014-10-21 19:19:44 +0200 |
commit | bc75205c773313a38a6958a6905a99bd56029196 (patch) | |
tree | f0031e5b1d85d55b2de6abe50f75d866dc5f4990 /src/libsystemd/sd-bus/bus-kernel.c | |
parent | 14f27b4e3b009d10bb9a3b43b74585c73a7c7626 (diff) |
sd-bus: sync kdbus.h (ABI break)
In kdbus.h, the following details changed:
* All commands gained a 'kernel_flags' field to report the flags supported
by the driver. Before, this was done in the 'flags' field in a
bidirectional way, which turned out to be a problem for the code in
sd-bus, as many parts of it reuse the same ioctl struct more than once
and consider them to be owned by userspace.
* Name listings are now returned by a new struct instead of reusing struct
kdbus_cmd_name for that matter. This way, we don't add more unneeded
fields to it and make the API cleaner.
* 'conn_flags' was renamed to 'flags' in struct kdbus_cmd_hello to make
the API a bit more unified.
Diffstat (limited to 'src/libsystemd/sd-bus/bus-kernel.c')
-rw-r--r-- | src/libsystemd/sd-bus/bus-kernel.c | 12 |
1 files changed, 3 insertions, 9 deletions
diff --git a/src/libsystemd/sd-bus/bus-kernel.c b/src/libsystemd/sd-bus/bus-kernel.c index c834071898..6b5a3d3713 100644 --- a/src/libsystemd/sd-bus/bus-kernel.c +++ b/src/libsystemd/sd-bus/bus-kernel.c @@ -714,7 +714,7 @@ int bus_kernel_take_fd(sd_bus *b) { hello = alloca0_align(sz, 8); hello->size = sz; - hello->conn_flags = b->hello_flags; + hello->flags = b->hello_flags; hello->attach_flags = b->attach_flags; hello->pool_size = KDBUS_POOL_SIZE; @@ -769,7 +769,7 @@ int bus_kernel_take_fd(sd_bus *b) { b->is_kernel = true; b->bus_client = true; - b->can_fds = !!(hello->conn_flags & KDBUS_HELLO_ACCEPT_FD); + b->can_fds = !!(hello->flags & KDBUS_HELLO_ACCEPT_FD); b->message_version = 2; b->message_endian = BUS_NATIVE_ENDIAN; @@ -820,7 +820,6 @@ static void close_kdbus_msg(sd_bus *bus, struct kdbus_msg *k) { int bus_kernel_write_message(sd_bus *bus, sd_bus_message *m, bool hint_sync_call) { int r; - uint64_t flags; assert(bus); assert(m); @@ -843,12 +842,7 @@ int bus_kernel_write_message(sd_bus *bus, sd_bus_message *m, bool hint_sync_call if (hint_sync_call) m->kdbus->flags |= KDBUS_MSG_FLAGS_EXPECT_REPLY|KDBUS_MSG_FLAGS_SYNC_REPLY; - /* The kernel will return the set of supported flags in m->kdbus->flags. - * Save the current message flags before issuing the ioctl, and restore them - * afterwards */ - flags = m->kdbus->flags; r = ioctl(bus->output_fd, KDBUS_CMD_MSG_SEND, m->kdbus); - m->kdbus->flags = flags; if (r < 0) { _cleanup_bus_error_free_ sd_bus_error error = SD_BUS_ERROR_NULL; sd_bus_message *reply; @@ -1559,7 +1553,7 @@ int bus_kernel_make_starter( } hello->size = size; - hello->conn_flags = + hello->flags = (activating ? KDBUS_HELLO_ACTIVATOR : KDBUS_HELLO_POLICY_HOLDER) | (accept_fd ? KDBUS_HELLO_ACCEPT_FD : 0); hello->pool_size = KDBUS_POOL_SIZE; |