return 0;
}
+_public_ int sd_bus_negotiate_attach_timestamp(sd_bus *bus, int b) {
+ assert_return(bus, -EINVAL);
+ assert_return(bus->state == BUS_UNSET, -EPERM);
+ assert_return(!bus_pid_changed(bus), -ECHILD);
+
+ SET_FLAG(bus->hello_flags, KDBUS_HELLO_ATTACH_TIMESTAMP, b);
+ return 0;
+}
+
+_public_ int sd_bus_negotiate_attach_creds(sd_bus *bus, int b) {
+ assert_return(bus, -EINVAL);
+ assert_return(bus->state == BUS_UNSET, -EPERM);
+ assert_return(!bus_pid_changed(bus), -ECHILD);
+
+ SET_FLAG(bus->hello_flags, KDBUS_HELLO_ATTACH_CREDS, b);
+ return 0;
+}
+
_public_ int sd_bus_negotiate_attach_comm(sd_bus *bus, int b) {
assert_return(bus, -EINVAL);
assert_return(bus->state == BUS_UNSET, -EPERM);
if (m->header->version > b->message_version)
return -EPERM;
- if (m->sealed)
+ if (m->sealed) {
+ /* If we copy the same message to multiple
+ * destinations, avoid using the same serial
+ * numbers. */
+ b->serial = MAX(b->serial, BUS_MESSAGE_SERIAL(m));
return 0;
+ }
return bus_message_seal(m, ++b->serial);
}