diff options
author | Kay Sievers <kay@vrfy.org> | 2013-04-15 23:32:38 +0200 |
---|---|---|
committer | Kay Sievers <kay@vrfy.org> | 2013-04-15 23:32:38 +0200 |
commit | b1454bf05cecb22e3009db204bf17ec72537c539 (patch) | |
tree | f6451b90b318a46e63f8fc1016fbb0747430bf6d /src | |
parent | 9a3ef988b8442360500e7df4db3ff27d2f13de10 (diff) |
bus: catch up with kernel changes
Diffstat (limited to 'src')
-rw-r--r-- | src/libsystemd-bus/bus-kernel.c | 16 | ||||
-rw-r--r-- | src/libsystemd-bus/kdbus.h | 6 |
2 files changed, 12 insertions, 10 deletions
diff --git a/src/libsystemd-bus/bus-kernel.c b/src/libsystemd-bus/bus-kernel.c index 3a9b8af844..cf5f7ee198 100644 --- a/src/libsystemd-bus/bus-kernel.c +++ b/src/libsystemd-bus/bus-kernel.c @@ -32,10 +32,10 @@ #include "bus-kernel.h" #include "bus-bloom.h" -#define KDBUS_MSG_FOREACH_DATA(d, k) \ - for ((d) = (k)->data; \ +#define KDBUS_FOREACH_ITEM(i, k) \ + for ((i) = (k)->items; \ (uint8_t*) (d) < (uint8_t*) (k) + (k)->size; \ - (d) = (struct kdbus_msg_data*) ((uint8_t*) (d) + ALIGN8((d)->size))) + (i) = (struct kdbus_msg_data*) ((uint8_t*) (i) + ALIGN8((i)->size))) static int parse_unique_name(const char *s, uint64_t *id) { int r; @@ -183,7 +183,7 @@ static int bus_message_setup_kmsg(sd_bus *b, sd_bus_message *m) { } else well_known = false; - sz = offsetof(struct kdbus_msg, data); + sz = offsetof(struct kdbus_msg, items); /* Add in fixed header, fields header and payload */ sz += 3 * ALIGN8(offsetof(struct kdbus_msg_data, vec) + sizeof(struct kdbus_vec)); @@ -214,7 +214,7 @@ static int bus_message_setup_kmsg(sd_bus *b, sd_bus_message *m) { m->kdbus->timeout_ns = m->timeout * NSEC_PER_USEC; - d = m->kdbus->data; + d = m->kdbus->items; if (well_known) append_destination(&d, m->destination, dl); @@ -333,7 +333,7 @@ int bus_kernel_write_message(sd_bus *bus, sd_bus_message *m) { static void close_kdbus_msg(struct kdbus_msg *k) { struct kdbus_msg_data *d; - KDBUS_MSG_FOREACH_DATA(d, k) { + KDBUS_FOREACH_ITEM(d, k) { if (d->type != KDBUS_MSG_UNIX_FDS) continue; @@ -359,7 +359,7 @@ static int bus_kernel_make_message(sd_bus *bus, struct kdbus_msg *k, sd_bus_mess if (k->payload_type != KDBUS_PAYLOAD_DBUS1) return 0; - KDBUS_MSG_FOREACH_DATA(d, k) { + KDBUS_FOREACH_ITEM(d, k) { size_t l; l = d->size - offsetof(struct kdbus_msg_data, data); @@ -409,7 +409,7 @@ static int bus_kernel_make_message(sd_bus *bus, struct kdbus_msg *k, sd_bus_mess if (r < 0) return r; - KDBUS_MSG_FOREACH_DATA(d, k) { + KDBUS_FOREACH_ITEM(d, k) { size_t l; l = d->size - offsetof(struct kdbus_msg_data, data); diff --git a/src/libsystemd-bus/kdbus.h b/src/libsystemd-bus/kdbus.h index cddf2ec30d..aac7b84352 100644 --- a/src/libsystemd-bus/kdbus.h +++ b/src/libsystemd-bus/kdbus.h @@ -114,6 +114,8 @@ struct kdbus_msg_data { union { /* inline data */ __u8 data[0]; + __u32 data32[0]; + __u64 data64[0]; char str[0]; /* data vector */ @@ -163,7 +165,7 @@ struct kdbus_msg { __u64 cookie_reply; /* cookie we reply to */ __u64 timeout_ns; /* timespan to wait for reply */ }; - struct kdbus_msg_data data[0]; + struct kdbus_msg_data items[0]; }; enum { @@ -329,7 +331,7 @@ enum { struct kdbus_cmd_name_info_item { __u64 size; __u64 type; - __u8 data[0]; + __u8 items[0]; }; struct kdbus_cmd_name_info { |