summary refs log tree commit diff
path: root/src/core/main.c
diff options
context:
space:
mode:
authorMichael Biebl <biebl@debian.org>2022-02-14 19:23:28 +0100
committerMichael Biebl <biebl@debian.org>2022-02-14 19:23:28 +0100
commit2f94dba7385fd0e0ef19a06eb4a2fcf6c43d7946 (patch)
treee2222f5577115985dd52044d2991253403cdd952 /src/core/main.c
parent88c227d90a6b7b388c5c85d72802a0ca8f05ed5c (diff)
New upstream version 1.35.91 upstream/1.35.91
Diffstat (limited to 'src/core/main.c')
-rw-r--r--src/core/main.c40
1 files changed, 14 insertions, 26 deletions
diff --git a/src/core/main.c b/src/core/main.c
index 7d448a59..e39a9614 100644
--- a/src/core/main.c
+++ b/src/core/main.c
@@ -54,9 +54,9 @@ static struct {
     gboolean become_daemon;
     gboolean g_fatal_warnings;
     gboolean run_from_build_dir;
-    char *   opt_log_level;
-    char *   opt_log_domains;
-    char *   pidfile;
+    char    *opt_log_level;
+    char    *opt_log_domains;
+    char    *pidfile;
 } global_opt = {
     .become_daemon = TRUE,
 };
@@ -153,9 +153,9 @@ static int
 print_config(NMConfigCmdLineOptions *config_cli)
 {
     gs_unref_object NMConfig *config = NULL;
-    gs_free_error GError *error      = NULL;
-    NMConfigData *        config_data;
-    const char *const *   warnings;
+    gs_free_error GError     *error  = NULL;
+    NMConfigData             *config_data;
+    const char *const        *warnings;
 
     nm_logging_setup("OFF", "ALL", NULL, NULL);
 
@@ -259,7 +259,7 @@ do_early_setup(int *argc, char **argv[], NMConfigCmdLineOptions *config_cli)
 static gboolean
 _dbus_manager_init(NMConfig *config)
 {
-    NMDBusManager *              busmgr;
+    NMDBusManager               *busmgr;
     NMConfigConfigureAndQuitType c_a_q_type;
 
     busmgr = nm_dbus_manager_get();
@@ -269,16 +269,6 @@ _dbus_manager_init(NMConfig *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_ENABLED) {
-        /* D-Bus is useless in configure and quit mode -- we're eventually dropping
-         * off and potential clients would have no way of knowing whether we're
-         * finished already or didn't start yet.
-         *
-         * But we still create a nm_dbus_manager_get_dbus_connection() D-Bus connection
-         * so that we can talk to other services like firewalld. */
-        return nm_dbus_manager_acquire_bus(busmgr, FALSE);
-    }
-
     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. */
@@ -292,16 +282,16 @@ _dbus_manager_init(NMConfig *config)
 int
 main(int argc, char *argv[])
 {
-    gboolean      success = FALSE;
-    NMManager *   manager = NULL;
-    NMConfig *    config;
-    gs_free_error GError *  error         = NULL;
+    gboolean                success = FALSE;
+    NMManager              *manager = NULL;
+    NMConfig               *config;
+    gs_free_error GError   *error         = NULL;
     gboolean                wrote_pidfile = FALSE;
-    char *                  bad_domains   = NULL;
+    char                   *bad_domains   = NULL;
     NMConfigCmdLineOptions *config_cli;
     guint                   sd_id                        = 0;
-    GError *                error_invalid_logging_config = NULL;
-    const char *const *     warnings;
+    GError                 *error_invalid_logging_config = NULL;
+    const char *const      *warnings;
     int                     errsv;
 
     _nm_utils_is_manager_process = TRUE;
@@ -338,8 +328,6 @@ main(int argc, char *argv[])
         exit(result);
     }
 
-    nm_main_utils_ensure_root();
-
     nm_main_utils_ensure_not_running_pidfile(global_opt.pidfile);
 
     nm_main_utils_ensure_statedir();