summaryrefslogtreecommitdiff
path: root/src/libsystemd/sd-bus/bus-control.c
diff options
context:
space:
mode:
authorDaniel Mack <daniel@zonque.org>2014-10-06 18:36:16 +0200
committerDaniel Mack <daniel@zonque.org>2014-10-06 18:36:16 +0200
commitd663f1b1a92a778bcdc68f29b8c08cb49431b4f7 (patch)
tree803f4d94844aecb45175f519492fc452228b8ec9 /src/libsystemd/sd-bus/bus-control.c
parent27c64db6dff88ebe9761dfe3b0c073d2a9bf2e41 (diff)
sd-bus: sync kdbus.h (ABI break)
The KDBUS_CMD_FREE ioctl now uses a struct rather than a direct pointer to the offset to free. The KDBUS_CMD_MSG_CANCEL ioctl has also changes, but there's no user of it yet in systemd.
Diffstat (limited to 'src/libsystemd/sd-bus/bus-control.c')
-rw-r--r--src/libsystemd/sd-bus/bus-control.c23
1 files changed, 20 insertions, 3 deletions
diff --git a/src/libsystemd/sd-bus/bus-control.c b/src/libsystemd/sd-bus/bus-control.c
index d9a53c702f..dbd94fc46b 100644
--- a/src/libsystemd/sd-bus/bus-control.c
+++ b/src/libsystemd/sd-bus/bus-control.c
@@ -223,6 +223,23 @@ _public_ int sd_bus_release_name(sd_bus *bus, const char *name) {
return bus_release_name_dbus1(bus, name);
}
+static int kernel_cmd_free(sd_bus *bus, uint64_t offset)
+{
+ struct kdbus_cmd_free cmd;
+ int r;
+
+ assert(bus);
+
+ cmd.flags = 0;
+ cmd.offset = offset;
+
+ r = ioctl(bus->input_fd, KDBUS_CMD_FREE, &cmd);
+ if (r < 0)
+ return -errno;
+
+ return 0;
+}
+
static int kernel_get_list(sd_bus *bus, uint64_t flags, char ***x) {
struct kdbus_cmd_name_list cmd = {};
struct kdbus_name_list *name_list;
@@ -269,9 +286,9 @@ static int kernel_get_list(sd_bus *bus, uint64_t flags, char ***x) {
}
}
- r = ioctl(bus->input_fd, KDBUS_CMD_FREE, &cmd.offset);
+ r = kernel_cmd_free(bus, cmd.offset);
if (r < 0)
- return -errno;
+ return r;
return 0;
}
@@ -597,7 +614,7 @@ static int bus_get_owner_kdbus(
r = 0;
fail:
- ioctl(bus->input_fd, KDBUS_CMD_FREE, &cmd->offset);
+ kernel_cmd_free(bus, cmd->offset);
return r;
}