diff options
author | Lennart Poettering <lennart@poettering.net> | 2013-05-15 01:43:15 +0200 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2013-05-15 01:43:15 +0200 |
commit | 9b29bb6853987bf6fef21531f69864fdfb39eb9a (patch) | |
tree | 85b58efc6f3b0955cad75df2f72069ab73e84341 /src/libsystemd-bus/bus-kernel.c | |
parent | 13c299d3a8603db8fdfc715eaea69ce5acd7aecb (diff) |
bus: add macro for iterating through body parts of a message
Diffstat (limited to 'src/libsystemd-bus/bus-kernel.c')
-rw-r--r-- | src/libsystemd-bus/bus-kernel.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/libsystemd-bus/bus-kernel.c b/src/libsystemd-bus/bus-kernel.c index 5b1769c0e1..3aa408414e 100644 --- a/src/libsystemd-bus/bus-kernel.c +++ b/src/libsystemd-bus/bus-kernel.c @@ -184,12 +184,13 @@ static int bus_message_setup_bloom(sd_bus_message *m, void *bloom) { } static int bus_message_setup_kmsg(sd_bus *b, sd_bus_message *m) { + struct bus_body_part *part; struct kdbus_item *d; bool well_known; uint64_t unique; size_t sz, dl; + unsigned i; int r; - struct bus_body_part *part; assert(b); assert(m); @@ -253,7 +254,7 @@ static int bus_message_setup_kmsg(sd_bus *b, sd_bus_message *m) { if (m->fields) append_payload_vec(&d, m->fields, ALIGN8(m->header->fields_size)); - for (part = &m->body; part && part->size > 0; part = part->next) + MESSAGE_FOREACH_PART(part, i, m) append_payload_vec(&d, part->data, part->size); if (m->kdbus->dst_id == KDBUS_DST_ID_BROADCAST) { |