chiark / gitweb /
networkd: move the connection to the bus out of manager_new (again)
authorTom Gundersen <teg@jklm.no>
Thu, 5 Feb 2015 17:00:16 +0000 (18:00 +0100)
committerTom Gundersen <teg@jklm.no>
Thu, 5 Feb 2015 17:02:42 +0000 (18:02 +0100)
This would otherwise make the tests fail as we cannot grab the bus name.

src/network/networkd-manager.c
src/network/networkd.c
src/network/networkd.h

index 02ab9f9..8dfe437 100644 (file)
@@ -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;
index 571f523..7319276 100644 (file)
@@ -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");
index e6d84f1..cd54e9b 100644 (file)
@@ -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);