summaryrefslogtreecommitdiff
path: root/src/network
diff options
context:
space:
mode:
authorTom Gundersen <teg@jklm.no>2015-02-05 18:00:16 +0100
committerTom Gundersen <teg@jklm.no>2015-02-05 18:02:42 +0100
commit8f203c166ecb24f904a068f2d8f0c636c1511a8f (patch)
tree6f7908cf4920da042c2fa9ec2239c32c64bcf20c /src/network
parent4852e15970ec652b823bf568b398f730be1fe1a5 (diff)
networkd: move the connection to the bus out of manager_new (again)
This would otherwise make the tests fail as we cannot grab the bus name.
Diffstat (limited to 'src/network')
-rw-r--r--src/network/networkd-manager.c6
-rw-r--r--src/network/networkd.c6
-rw-r--r--src/network/networkd.h1
3 files changed, 7 insertions, 6 deletions
diff --git a/src/network/networkd-manager.c b/src/network/networkd-manager.c
index 02ab9f95ef..8dfe4377de 100644
--- a/src/network/networkd-manager.c
+++ b/src/network/networkd-manager.c
@@ -78,8 +78,6 @@ static int setup_default_address_pool(Manager *m) {
return 0;
}
-int manager_connect_bus(Manager *m);
-
static int on_bus_retry(sd_event_source *s, usec_t usec, void *userdata) {
Manager *m = userdata;
@@ -437,10 +435,6 @@ int manager_new(Manager **ret) {
if (r < 0)
return r;
- r = manager_connect_bus(m);
- if (r < 0)
- return r;
-
r = manager_connect_udev(m);
if (r < 0)
return r;
diff --git a/src/network/networkd.c b/src/network/networkd.c
index 571f523898..7319276c53 100644
--- a/src/network/networkd.c
+++ b/src/network/networkd.c
@@ -86,6 +86,12 @@ int main(int argc, char *argv[]) {
goto out;
}
+ r = manager_connect_bus(m);
+ if (r < 0) {
+ log_error_errno(r, "Could not connect to bus: %m");
+ goto out;
+ }
+
r = manager_load_config(m);
if (r < 0) {
log_error_errno(r, "Could not load configuration files: %m");
diff --git a/src/network/networkd.h b/src/network/networkd.h
index e6d84f105b..cd54e9bb06 100644
--- a/src/network/networkd.h
+++ b/src/network/networkd.h
@@ -239,6 +239,7 @@ extern const sd_bus_vtable manager_vtable[];
int manager_new(Manager **ret);
void manager_free(Manager *m);
+int manager_connect_bus(Manager *m);
int manager_run(Manager *m);
int manager_load_config(Manager *m);