summaryrefslogtreecommitdiff
path: root/manager.c
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2010-04-06 16:32:07 +0200
committerLennart Poettering <lennart@poettering.net>2010-04-06 16:32:07 +0200
commitf278026d21e2ded46f7f91152d60842525e74956 (patch)
tree5d1e22f332a64f807a0750a1902a6724f16c89db /manager.c
parent8b44eabff0dd0dcbee1af637bc7d9d2b9dfcd427 (diff)
dbus: connect to bus as soon as the special dbus service is around
Diffstat (limited to 'manager.c')
-rw-r--r--manager.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/manager.c b/manager.c
index 87941e3f56..234fb93c1e 100644
--- a/manager.c
+++ b/manager.c
@@ -315,8 +315,11 @@ int manager_new(Manager **_m) {
if ((r = manager_setup_cgroup(m)) < 0)
goto fail;
- /* FIXME: this should be called only when the D-Bus bus daemon is running */
- if ((r = bus_init(m)) < 0)
+ dbus_connection_set_change_sigpipe(FALSE);
+
+ /* Try to connect to the busses, if possible. */
+ if ((r = bus_init_system(m)) < 0 ||
+ (r = bus_init_api(m)) < 0)
goto fail;
*_m = m;
@@ -364,7 +367,8 @@ void manager_free(Manager *m) {
manager_shutdown_cgroup(m);
- bus_done(m);
+ bus_done_api(m);
+ bus_done_system(m);
hashmap_free(m->units);
hashmap_free(m->jobs);