diff options
author | Lennart Poettering <lennart@poettering.net> | 2013-05-22 16:02:21 +0200 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2013-05-22 16:04:39 +0200 |
commit | 8f155917bf5c11c8f156d7f25f242257d6086cb9 (patch) | |
tree | 5b34963cd80961ca0353f93e0598e1a2b6451738 /src/libsystemd-bus/bus-message.c | |
parent | 2927b326ccf67236e148444679f582ea1437ef5a (diff) |
bus: add benchmark tool to determine the right threshold for copying vs. memfd
Diffstat (limited to 'src/libsystemd-bus/bus-message.c')
-rw-r--r-- | src/libsystemd-bus/bus-message.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/libsystemd-bus/bus-message.c b/src/libsystemd-bus/bus-message.c index e531dec5cd..55c2d62885 100644 --- a/src/libsystemd-bus/bus-message.c +++ b/src/libsystemd-bus/bus-message.c @@ -564,7 +564,7 @@ static int message_new_reply( goto fail; if (call->sender) { - r = message_append_field_string(t, SD_BUS_MESSAGE_HEADER_DESTINATION, SD_BUS_TYPE_STRING, call->sender, &t->sender); + r = message_append_field_string(t, SD_BUS_MESSAGE_HEADER_DESTINATION, SD_BUS_TYPE_STRING, call->sender, &t->destination); if (r < 0) goto fail; } @@ -3865,9 +3865,9 @@ int bus_message_seal(sd_bus_message *m, uint64_t serial) { /* If this is something we can send as memfd, then let's seal the memfd now. Note that we can send memfds as payload only for directed messages, and not for broadcasts. */ - if (m->destination) { + if (m->destination && m->bus && m->bus->use_memfd) { MESSAGE_FOREACH_PART(part, i, m) - if (part->memfd >= 0 && !part->sealed && part->size > MEMFD_MIN_SIZE) { + if (part->memfd >= 0 && !part->sealed && (part->size > MEMFD_MIN_SIZE || m->bus->use_memfd < 0)) { bus_body_part_unmap(part); if (ioctl(part->memfd, KDBUS_CMD_MEMFD_SEAL_SET, 1) >= 0) |