summaryrefslogtreecommitdiff
path: root/src/libsystemd-bus/sd-bus.c
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2013-04-11 02:09:36 +0200
committerLennart Poettering <lennart@poettering.net>2013-04-11 23:10:40 +0200
commit2100fa1099b086411270a2876dde0532ea2806fa (patch)
treef58974c466048ba1b4f8d65017bda6b686814b9d /src/libsystemd-bus/sd-bus.c
parent9be9c7cff600018279a0c3fa5fbe719bd1c0b8ad (diff)
bus: calculate iovec for messages only when we need it
Diffstat (limited to 'src/libsystemd-bus/sd-bus.c')
-rw-r--r--src/libsystemd-bus/sd-bus.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/libsystemd-bus/sd-bus.c b/src/libsystemd-bus/sd-bus.c
index 2f084c26b3..89172e6369 100644
--- a/src/libsystemd-bus/sd-bus.c
+++ b/src/libsystemd-bus/sd-bus.c
@@ -965,7 +965,7 @@ static int dispatch_wqueue(sd_bus *bus) {
} else if (r == 0)
/* Didn't do anything this time */
return ret;
- else if (bus->windex >= bus->wqueue[0]->size) {
+ else if (bus->windex >= bus_message_size(bus->wqueue[0])) {
/* Fully written. Let's drop the entry from
* the queue.
*
@@ -1066,7 +1066,7 @@ int sd_bus_send(sd_bus *bus, sd_bus_message *m, uint64_t *serial) {
if (r < 0) {
sd_bus_close(bus);
return r;
- } else if (idx < m->size) {
+ } else if (idx < bus_message_size(m)) {
/* Wasn't fully written. So let's remember how
* much was written. Note that the first entry
* of the wqueue array is always allocated so