bus: implicitly set no_reply flag on outgoing messages if the serial number is not kept

If nobody keeps the serial number of an outgoing message we know that
nobody expects an answer to it, so set the no_reply flag accordingly.
This commit is contained in:
Lennart Poettering 2013-03-21 23:01:59 +01:00
parent 9a8ae49d91
commit 29f6aadd53
2 changed files with 5 additions and 1 deletions

View File

@ -1057,6 +1057,11 @@ int sd_bus_send(sd_bus *bus, sd_bus_message *m, uint64_t *serial) {
if (!m)
return -EINVAL;
/* If the serial number isn't kept, then we know that no reply
* is expected */
if (!serial && !m->sealed)
m->header->flags |= SD_BUS_MESSAGE_NO_REPLY_EXPECTED;
r = bus_seal_message(bus, m);
if (r < 0)
return r;

View File

@ -33,7 +33,6 @@
* - add page donation logic
* - api for appending/reading fixed arrays
* - always verify container depth
* - implicitly set no_reply when a message-call is sent an the serial number ignored
* - handle NULL strings nicer when appending
* - merge busctl into systemctl or so?
* - add object handlers