diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/libsystemd-bus/bus-control.c | 2 | ||||
-rw-r--r-- | src/libsystemd-bus/bus-kernel.c | 12 | ||||
-rw-r--r-- | src/libsystemd-bus/bus-kernel.h | 14 |
3 files changed, 14 insertions, 14 deletions
diff --git a/src/libsystemd-bus/bus-control.c b/src/libsystemd-bus/bus-control.c index 1d416b7dc4..7cb7d44ae9 100644 --- a/src/libsystemd-bus/bus-control.c +++ b/src/libsystemd-bus/bus-control.c @@ -507,7 +507,7 @@ int bus_add_match_internal( item->type = KDBUS_MATCH_BLOOM; memcpy(item->data64, bloom, BLOOM_SIZE); - item = KDBUS_ITEM_NEXT(item); + item = KDBUS_PART_NEXT(item); } if (sender) { diff --git a/src/libsystemd-bus/bus-kernel.c b/src/libsystemd-bus/bus-kernel.c index f2b130b438..9d4b6cf721 100644 --- a/src/libsystemd-bus/bus-kernel.c +++ b/src/libsystemd-bus/bus-kernel.c @@ -409,7 +409,7 @@ static void close_kdbus_msg(sd_bus *bus, struct kdbus_msg *k) { off = (uint8_t *)k - (uint8_t *)bus->kdbus_buffer; ioctl(bus->input_fd, KDBUS_CMD_MSG_RELEASE, &off); - KDBUS_ITEM_FOREACH(d, k) { + KDBUS_PART_FOREACH(d, k, items) { if (d->type == KDBUS_MSG_FDS) close_many(d->fds, (d->size - offsetof(struct kdbus_item, fds)) / sizeof(int)); @@ -435,7 +435,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_ITEM_FOREACH(d, k) { + KDBUS_PART_FOREACH(d, k, items) { size_t l; l = d->size - offsetof(struct kdbus_item, data); @@ -489,7 +489,7 @@ static int bus_kernel_make_message(sd_bus *bus, struct kdbus_msg *k, sd_bus_mess if (r < 0) return r; - KDBUS_ITEM_FOREACH(d, k) { + KDBUS_PART_FOREACH(d, k, items) { size_t l; l = d->size - offsetof(struct kdbus_item, data); @@ -685,13 +685,13 @@ int bus_kernel_create(const char *name, char **s) { l = strlen(name); make = alloca0(offsetof(struct kdbus_cmd_bus_make, items) + - KDBUS_ITEM_HEADER_SIZE + sizeof(uint64_t) + - KDBUS_ITEM_HEADER_SIZE + DECIMAL_STR_MAX(uid_t) + 1 + l + 1); + KDBUS_PART_HEADER_SIZE + sizeof(uint64_t) + + KDBUS_PART_HEADER_SIZE + DECIMAL_STR_MAX(uid_t) + 1 + l + 1); n = make->items; n->type = KDBUS_MAKE_NAME; sprintf(n->str, "%lu-%s", (unsigned long) getuid(), name); - n->size = KDBUS_ITEM_HEADER_SIZE + strlen(n->str) + 1; + n->size = KDBUS_PART_HEADER_SIZE + strlen(n->str) + 1; make->size = offsetof(struct kdbus_cmd_bus_make, items) + n->size; make->flags = KDBUS_MAKE_POLICY_OPEN; diff --git a/src/libsystemd-bus/bus-kernel.h b/src/libsystemd-bus/bus-kernel.h index c4573c9222..69df4f4e9e 100644 --- a/src/libsystemd-bus/bus-kernel.h +++ b/src/libsystemd-bus/bus-kernel.h @@ -23,16 +23,16 @@ #include "sd-bus.h" -#define KDBUS_ITEM_NEXT(item) \ +#define KDBUS_PART_NEXT(item) \ (typeof(item))(((uint8_t *)item) + ALIGN8((item)->size)) -#define KDBUS_ITEM_FOREACH(item, head) \ - for (item = (head)->items; \ - (uint8_t *)(item) < (uint8_t *)(head) + (head)->size; \ - item = KDBUS_ITEM_NEXT(item)) +#define KDBUS_PART_FOREACH(part, head, first) \ + for (part = (head)->first; \ + (uint8_t *)(part) < (uint8_t *)(head) + (head)->size; \ + part = KDBUS_PART_NEXT(part)) -#define KDBUS_ITEM_HEADER_SIZE offsetof(struct kdbus_item, data) -#define KDBUS_ITEM_SIZE(s) ALIGN8((s) + KDBUS_ITEM_HEADER_SIZE) +#define KDBUS_PART_HEADER_SIZE offsetof(struct kdbus_item, data) +#define KDBUS_ITEM_SIZE(s) ALIGN8((s) + KDBUS_PART_HEADER_SIZE) #define MEMFD_CACHE_MAX 32 |