sd-bus: when removing a server-side match, do so in "fire and forget" fashion

We currently wait for the RemoveMatch() reply, but then ignore what it
actually says. Let's optimize this a bit, and not even ask for an answer
back: just enqueue the RemoveMatch() operation, and do not request not
wait for any answer.
This commit is contained in:
Lennart Poettering
2018-01-05 13:58:32 +01:00
parent aec7b7bae7
commit acd340158a
2 changed files with 5 additions and 2 deletions
+4 -1
View File
@@ -851,8 +851,11 @@ int bus_remove_match_internal(
e = append_eavesdrop(bus, match);
return sd_bus_call_method(
/* Fire and forget */
return sd_bus_call_method_async(
bus,
NULL,
"org.freedesktop.DBus",
"/org/freedesktop/DBus",
"org.freedesktop.DBus",
+1 -1
View File
@@ -94,7 +94,7 @@ void bus_slot_disconnect(sd_bus_slot *slot) {
case BUS_MATCH_CALLBACK:
if (slot->match_added)
bus_remove_match_internal(slot->bus, slot->match_callback.match_string);
(void) bus_remove_match_internal(slot->bus, slot->match_callback.match_string);
slot->bus->match_callbacks_modified = true;
bus_match_remove(&slot->bus->match_callbacks, &slot->match_callback);