chiark / gitweb /
bus: pass timestamp info only to caller if he asked for it
authorLennart Poettering <lennart@poettering.net>
Wed, 22 Jan 2014 15:44:32 +0000 (16:44 +0100)
committerLennart Poettering <lennart@poettering.net>
Wed, 22 Jan 2014 15:44:32 +0000 (16:44 +0100)
src/libsystemd/sd-bus/bus-kernel.c

index 95efbbe..f547ebf 100644 (file)
@@ -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: