chiark / gitweb /
sd-bus: optionally, exit process or event loop on disconnect
authorLennart Poettering <lennart@poettering.net>
Mon, 22 Aug 2016 15:19:12 +0000 (17:19 +0200)
committerSven Eden <yamakuzure@gmx.net>
Wed, 5 Jul 2017 06:50:52 +0000 (08:50 +0200)
commite5f3b69738bd680745e3ca8a54d9935303879199
treea322f072275fe89132ca45c02fb4c7937cc2aec7
parenteaa22dd2515e82ba7de62259dab06fbd156284ca
sd-bus: optionally, exit process or event loop on disconnect

Old libdbus has a feature that the process is terminated whenever the the bus
connection receives a disconnect. This is pretty useful on desktop apps (where
a disconnect indicates session termination), as well as on command line apps
(where we really shouldn't stay hanging in most cases if dbus daemon goes
down).

Add a similar feature to sd-bus, but make it opt-in rather than opt-out, like
it is on libdbus. Also, if the bus is attached to an event loop just exit the
event loop rather than the the whole process.
src/libelogind/sd-bus/bus-internal.h
src/libelogind/sd-bus/sd-bus.c