From 41add995cf7d61e299cb859a7f63117e2b4de312 Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Wed, 22 Jan 2014 16:44:32 +0100 Subject: bus: pass timestamp info only to caller if he asked for it --- src/libsystemd/sd-bus/bus-kernel.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'src/libsystemd') diff --git a/src/libsystemd/sd-bus/bus-kernel.c b/src/libsystemd/sd-bus/bus-kernel.c index 95efbbeeb8..f547ebf134 100644 --- a/src/libsystemd/sd-bus/bus-kernel.c +++ b/src/libsystemd/sd-bus/bus-kernel.c @@ -500,9 +500,13 @@ static int bus_kernel_make_message(sd_bus *bus, struct kdbus_msg *k) { break; case KDBUS_ITEM_TIMESTAMP: - m->realtime = d->timestamp.realtime_ns / NSEC_PER_USEC; - m->monotonic = d->timestamp.monotonic_ns / NSEC_PER_USEC; - m->seqnum = d->timestamp.seqnum; + + if (bus->attach_flags & KDBUS_ATTACH_TIMESTAMP) { + m->realtime = d->timestamp.realtime_ns / NSEC_PER_USEC; + m->monotonic = d->timestamp.monotonic_ns / NSEC_PER_USEC; + m->seqnum = d->timestamp.seqnum; + } + break; case KDBUS_ITEM_PID_COMM: -- cgit v1.2.3-54-g00ecf