chiark / gitweb /
bus: conditionally set cookie_reply/timeout and update kdbus.h
[elogind.git] / src / libsystemd-bus / bus-kernel.c
index c15218fe984097dcd3dbc7d29c90ffc4e31820eb..7944f5138356f0b74cdb046b5b5519f57895fe10 100644 (file)
@@ -257,8 +257,11 @@ static int bus_message_setup_kmsg(sd_bus *b, sd_bus_message *m) {
                 m->destination ? unique : KDBUS_DST_ID_BROADCAST;
         m->kdbus->payload_type = KDBUS_PAYLOAD_DBUS;
         m->kdbus->cookie = m->header->serial;
-        m->kdbus->cookie_reply = m->reply_serial;
-        m->kdbus->timeout_ns = m->timeout * NSEC_PER_USEC;
+
+        if (m->header->flags & BUS_MESSAGE_NO_REPLY_EXPECTED)
+                m->kdbus->cookie_reply = m->reply_serial;
+        else
+                m->kdbus->timeout_ns = m->timeout * NSEC_PER_USEC;
 
         d = m->kdbus->items;