sd-bus: fix exiting event loop when sd_bus_set_exit_on_disconnect is used
authorLuca Boccassi <bluca@debian.org>
Thu, 25 Jan 2024 20:31:39 +0000 (20:31 +0000)
committerDaan De Meyer <daan.j.demeyer@gmail.com>
Fri, 26 Jan 2024 07:59:46 +0000 (08:59 +0100)
commitb5d4862707d0b3829c500904474fa2453ffaa525
treea6a597182430d90f38d6240a088706ec9deba903
parent9b8dd5fbead2e8c75c5330bfb2b8ad20b73f7d13
sd-bus: fix exiting event loop when sd_bus_set_exit_on_disconnect is used

If sd_bus_set_exit_on_disconnect is used and the bus is part of an event
loop, and the D-Bus connection goes away (e.g.: soft-reboot), sd-bus
will always exit() the program instead of returning from the loop, as
the reference to the event is removed before it is checked.
src/libsystemd/sd-bus/sd-bus.c
src/libsystemd/sd-bus/test-bus-watch-bind.c