summaryrefslogtreecommitdiff
path: root/src/libsystemd-bus/bus-kernel.c
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2013-05-15 19:45:05 +0200
committerLennart Poettering <lennart@poettering.net>2013-05-15 19:45:45 +0200
commit453a0c2946da620f99825d39db335e9ea9861829 (patch)
treecb994a26bf2b84d0c6090e88d8ccb113aeef37e6 /src/libsystemd-bus/bus-kernel.c
parent99271804172f6ac51be9556b2bdf37d6a7e952bc (diff)
bus: add support for adding memfds into message payload
Diffstat (limited to 'src/libsystemd-bus/bus-kernel.c')
-rw-r--r--src/libsystemd-bus/bus-kernel.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/libsystemd-bus/bus-kernel.c b/src/libsystemd-bus/bus-kernel.c
index 81469365f0..54a5e1691c 100644
--- a/src/libsystemd-bus/bus-kernel.c
+++ b/src/libsystemd-bus/bus-kernel.c
@@ -486,10 +486,11 @@ static int bus_kernel_make_message(sd_bus *bus, struct kdbus_msg *k, sd_bus_mess
part->data = UINT64_TO_PTR(d->vec.address);
part->size = d->vec.size;
} else {
- part->data = (uint8_t*) UINT64_TO_PTR(d->vec.address) + (begin_body - idx);
+ part->data = d->vec.address != 0 ? (uint8_t*) UINT64_TO_PTR(d->vec.address) + (begin_body - idx) : NULL;
part->size = d->vec.size - (begin_body - idx);
}
+ part->is_zero = d->vec.address == 0;
part->sealed = true;
}