diff options
author | David Herrmann <dh.herrmann@gmail.com> | 2014-12-11 13:19:41 +0100 |
---|---|---|
committer | David Herrmann <dh.herrmann@gmail.com> | 2014-12-11 13:19:41 +0100 |
commit | 94e15fdc4d9d96fa6607bfb4eaaea164a3aec417 (patch) | |
tree | a0007d59619f3e3484a42f44b47b44e0e8e9c865 /src/core/busname.c | |
parent | 055b27f29484b625e03706319c918e3a644e00b9 (diff) |
bus: sync with kdbus.git
Sync up with recent kdbus changed:
* several ioctls gained .size and .items members (but still unused)
* CMD_SEND gained its own ioctl structure
* several members of kdbus_msg were dropped as they were only used during
SEND, not during RECV etc.
* CMD_RECV and CMD_SEND now share a kdbus_reply member which contains the
offset and size of the returned message.
Diffstat (limited to 'src/core/busname.c')
-rw-r--r-- | src/core/busname.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/src/core/busname.c b/src/core/busname.c index 99641ec418..d4aa463397 100644 --- a/src/core/busname.c +++ b/src/core/busname.c @@ -727,6 +727,7 @@ _pure_ static const char *busname_sub_state_to_string(Unit *u) { static int busname_peek_message(BusName *n) { struct kdbus_cmd_recv cmd_recv = { + .size = sizeof(cmd_recv), .flags = KDBUS_RECV_PEEK, }; struct kdbus_cmd_free cmd_free = {}; @@ -750,7 +751,7 @@ static int busname_peek_message(BusName *n) { if (log_get_max_level() < LOG_DEBUG) return 0; - r = ioctl(n->starter_fd, KDBUS_CMD_MSG_RECV, &cmd_recv); + r = ioctl(n->starter_fd, KDBUS_CMD_RECV, &cmd_recv); if (r < 0) { if (errno == EINTR || errno == EAGAIN) return 0; @@ -766,9 +767,9 @@ static int busname_peek_message(BusName *n) { * longer than necessary. */ ps = page_size(); - start = (cmd_recv.offset / ps) * ps; - delta = cmd_recv.offset - start; - sz = PAGE_ALIGN(delta + cmd_recv.msg_size); + start = (cmd_recv.reply.offset / ps) * ps; + delta = cmd_recv.reply.offset - start; + sz = PAGE_ALIGN(delta + cmd_recv.reply.msg_size); p = mmap(NULL, sz, PROT_READ, MAP_SHARED, n->starter_fd, start); if (p == MAP_FAILED) { @@ -800,7 +801,7 @@ finish: if (p) (void) munmap(p, sz); - cmd_free.offset = cmd_recv.offset; + cmd_free.offset = cmd_recv.reply.offset; if (ioctl(n->starter_fd, KDBUS_CMD_FREE, &cmd_free) < 0) log_unit_warning(UNIT(n)->id, "Failed to free peeked message, ignoring: %m"); |