summaryrefslogtreecommitdiff
path: root/src/network/networkd-manager.c
diff options
context:
space:
mode:
authorTom Gundersen <teg@jklm.no>2015-02-11 12:57:58 +0100
committerTom Gundersen <teg@jklm.no>2015-02-11 13:13:49 +0100
commitf806f64c7460632d6b6c27865e1554cb6c934320 (patch)
tree846e6726ac7a8c894f5b565880d5e025082a8143 /src/network/networkd-manager.c
parentf4f01ec146d91cb6943828851d98eee6a1ad4dd9 (diff)
networkd: don't do exit-on-idle if there is something wrong with the dbus connection
Just fall back to plain old event loop in this (highly unlikely) case. In the glorious future when kdbus is upstream we can of course drop all this.
Diffstat (limited to 'src/network/networkd-manager.c')
-rw-r--r--src/network/networkd-manager.c19
1 files changed, 12 insertions, 7 deletions
diff --git a/src/network/networkd-manager.c b/src/network/networkd-manager.c
index 4617f11867..ce97ac0778 100644
--- a/src/network/networkd-manager.c
+++ b/src/network/networkd-manager.c
@@ -534,13 +534,18 @@ static bool manager_check_idle(void *userdata) {
int manager_run(Manager *m) {
assert(m);
- return bus_event_loop_with_idle(
- m->event,
- m->bus,
- "org.freedesktop.network1",
- DEFAULT_EXIT_USEC,
- manager_check_idle,
- m);
+ if (m->bus)
+ return bus_event_loop_with_idle(
+ m->event,
+ m->bus,
+ "org.freedesktop.network1",
+ DEFAULT_EXIT_USEC,
+ manager_check_idle,
+ m);
+ else
+ /* failed to connect to the bus, so we lose exit-on-idle logic,
+ this should not happen except if dbus is not around at all */
+ return sd_event_loop(m->event);
}
int manager_load_config(Manager *m) {