X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=blobdiff_plain;f=src%2Flibelogind%2Fsd-bus%2Fsd-bus.c;h=87263b74f24ae290246a0c0e7b997f46ba435838;hb=8af9597bdb2f17e0220c90299a322cfff3c4195f;hp=0c18296e13dad53b32e37022b6f4a40b11c16b2a;hpb=7b3cb911e7ddb15cc8f7b1bf0a19c5619b58e23c;p=elogind.git diff --git a/src/libelogind/sd-bus/sd-bus.c b/src/libelogind/sd-bus/sd-bus.c index 0c18296e1..87263b74f 100644 --- a/src/libelogind/sd-bus/sd-bus.c +++ b/src/libelogind/sd-bus/sd-bus.c @@ -1425,6 +1425,17 @@ _public_ void sd_bus_close(sd_bus *bus) { * ioctl on the fd when they are freed. */ } +_public_ sd_bus* sd_bus_flush_close_unref(sd_bus *bus) { + + if (!bus) + return NULL; + + sd_bus_flush(bus); + sd_bus_close(bus); + + return sd_bus_unref(bus); +} + static void bus_enter_closing(sd_bus *bus) { assert(bus); @@ -2942,10 +2953,8 @@ _public_ int sd_bus_add_match( /* Do not install server-side matches for matches * against the local service, interface or bus - * path. Also, when on kdbus don't install driver - * matches server side. */ - if (scope == BUS_MATCH_GENERIC || - (!bus->is_kernel && scope == BUS_MATCH_DRIVER)) { + * path. */ + if (scope != BUS_MATCH_LOCAL) { if (!bus->is_kernel) { /* When this is not a kernel transport, we