From 0587dbe96c977787188f03bb2b7a60169fdc05bc Mon Sep 17 00:00:00 2001 From: Thomas Haller Date: Fri, 13 Mar 2015 19:42:21 +0100 Subject: [PATCH] main: (order) call g_type_init() very early in main() g_type_init() is independent of all NetworkManager functionality. Just get it done early on. --- src/main.c | 8 ++++---- src/nm-iface-helper.c | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/main.c b/src/main.c index 77866a473d..9018dc6e80 100644 --- a/src/main.c +++ b/src/main.c @@ -259,6 +259,10 @@ main (int argc, char *argv[]) char *bad_domains = NULL; NMConfigCmdLineOptions *config_cli; +#if !GLIB_CHECK_VERSION (2, 35, 0) + g_type_init (); +#endif + _nm_utils_is_manager_process = TRUE; main_loop = g_main_loop_new (NULL, FALSE); @@ -388,10 +392,6 @@ main (int argc, char *argv[]) nm_logging_syslog_openlog (global_opt.debug); -#if !GLIB_CHECK_VERSION (2, 35, 0) - g_type_init (); -#endif - dbus_threads_init_default (); /* Ensure that non-exported properties don't leak out, and that the diff --git a/src/nm-iface-helper.c b/src/nm-iface-helper.c index 8fc420df3d..87e0830ba9 100644 --- a/src/nm-iface-helper.c +++ b/src/nm-iface-helper.c @@ -311,6 +311,10 @@ do_early_setup (int *argc, char **argv[]) {NULL} }; +#if !GLIB_CHECK_VERSION (2, 35, 0) + g_type_init (); +#endif + setpgid (getpid (), getpid ()); if (!nm_main_utils_early_setup ("nm-iface-helper", @@ -408,10 +412,6 @@ main (int argc, char *argv[]) nm_logging_syslog_openlog (global_opt.debug); -#if !GLIB_CHECK_VERSION (2, 35, 0) - g_type_init (); -#endif - nm_log_info (LOGD_CORE, "nm-iface-helper (version " NM_DIST_VERSION ") is starting..."); /* Set up platform interaction layer */