summaryrefslogtreecommitdiff
path: root/src/dbus.c
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2011-01-20 19:43:38 +0100
committerLennart Poettering <lennart@poettering.net>2011-01-20 19:43:38 +0100
commit3996fbe2a2a212d9ac983950602cc09db55d77ef (patch)
tree8ba6323f1875c005ac310f2d12c95ba912a6630e /src/dbus.c
parent867b3b7d6b88ba4d07ec7c830576d4ac2f7dd226 (diff)
dbus: don't try to connect to the system bus before it is actually up
Diffstat (limited to 'src/dbus.c')
-rw-r--r--src/dbus.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/src/dbus.c b/src/dbus.c
index 48051f25fb..d7b80ba01d 100644
--- a/src/dbus.c
+++ b/src/dbus.c
@@ -982,7 +982,7 @@ fail:
return r;
}
-int bus_init(Manager *m) {
+int bus_init(Manager *m, bool try_bus_connect) {
int r;
if (set_ensure_allocated(&m->bus_connections, trivial_hash_func, trivial_compare_func) < 0 ||
@@ -1003,9 +1003,13 @@ int bus_init(Manager *m) {
return -ENOMEM;
}
- if ((r = bus_init_system(m)) < 0 ||
- (r = bus_init_api(m)) < 0 ||
- (r = bus_init_private(m)) < 0)
+ if (try_bus_connect) {
+ if ((r = bus_init_system(m)) < 0 ||
+ (r = bus_init_api(m)) < 0)
+ return r;
+ }
+
+ if ((r = bus_init_private(m)) < 0)
return r;
return 0;