summaryrefslogtreecommitdiff
path: root/src/libsystemd
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2014-01-22 16:44:32 +0100
committerLennart Poettering <lennart@poettering.net>2014-01-22 16:44:32 +0100
commit41add995cf7d61e299cb859a7f63117e2b4de312 (patch)
tree6fb3b6e165c6043b41dc25136dcd4d3ad27bf1ee /src/libsystemd
parentcccb0b2cdbd25e90ae92d2d5b107125cb1ca3433 (diff)
bus: pass timestamp info only to caller if he asked for it
Diffstat (limited to 'src/libsystemd')
-rw-r--r--src/libsystemd/sd-bus/bus-kernel.c10
1 files changed, 7 insertions, 3 deletions
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: