]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
sd-bus: when removing a server-side match, do so in "fire and forget" fashion
authorLennart Poettering <lennart@poettering.net>
Mon, 18 Dec 2017 19:50:26 +0000 (20:50 +0100)
committerLennart Poettering <lennart@poettering.net>
Fri, 5 Jan 2018 12:58:32 +0000 (13:58 +0100)
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.

src/libsystemd/sd-bus/bus-control.c
src/libsystemd/sd-bus/bus-slot.c

index aa247db07f1b475c626f4c4337fa3353991b32f6..7182616d2ac274de78f8618ecc8712664a114593 100644 (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",
index f8de699b3d2e7c20595250dcba09b1729121b2dc..0b5e2b7db1f747dcbaac15e64e6a1663385f8e84 100644 (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);