about summary refs log tree commit diff
path: root/src/core/main.c
diff options
context:
space:
mode:
authorMichael Biebl <biebl@debian.org>2023-08-09 21:56:59 +0200
committerMichael Biebl <biebl@debian.org>2023-08-09 21:56:59 +0200
commitb1206f287e4fae1f9a7e29ec0dc11b54d726a7f8 (patch)
treecc1d62cd21f10b2375c76484b5e2187f1e75f010 /src/core/main.c
parenta6d4d07b23485507f30ddb1ce99f5c82428714c8 (diff)
parent05e4a733f2141995181a551854d5df929f084adf (diff)
Update upstream source from tag 'upstream/1.44.0'
Update to upstream version '1.44.0'
with Debian dir e69e19b54914190e7696747b3e0508f95977f387
Diffstat (limited to 'src/core/main.c')
-rw-r--r--src/core/main.c16
1 files changed, 10 insertions, 6 deletions
diff --git a/src/core/main.c b/src/core/main.c
index 2eb230d9..4c7de6cd 100644
--- a/src/core/main.c
+++ b/src/core/main.c
@@ -266,13 +266,14 @@ _dbus_manager_init(NMConfig *config)
 
     c_a_q_type = nm_config_get_configure_and_quit(config);
 
-    if (c_a_q_type == NM_CONFIG_CONFIGURE_AND_QUIT_DISABLED)
-        return nm_dbus_manager_acquire_bus(busmgr, TRUE);
+    if (c_a_q_type == NM_CONFIG_CONFIGURE_AND_QUIT_INITRD) {
+        /* in initrd we don't have D-Bus at all. Don't even try to get the G_BUS_TYPE_SYSTEM
+         * connection. And of course don't claim the D-Bus name. */
+        return TRUE;
+    }
 
-    nm_assert(c_a_q_type == NM_CONFIG_CONFIGURE_AND_QUIT_INITRD);
-    /* in initrd we don't have D-Bus at all. Don't even try to get the G_BUS_TYPE_SYSTEM
-     * connection. And of course don't claim the D-Bus name. */
-    return TRUE;
+    nm_assert(c_a_q_type == NM_CONFIG_CONFIGURE_AND_QUIT_DISABLED);
+    return nm_dbus_manager_setup(busmgr);
 }
 
 /*
@@ -507,6 +508,9 @@ main(int argc, char *argv[])
     nm_log_dbg(LOGD_CORE, "setting up local loopback");
     nm_platform_link_change_flags(NM_PLATFORM_GET, 1, IFF_UP, TRUE);
 
+    if (!nm_dbus_manager_request_name_sync(nm_dbus_manager_get()))
+        goto done;
+
     success = TRUE;
 
     if (configure_and_quit == FALSE) {