summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Haller <thaller@redhat.com>2015-03-13 19:42:21 +0100
committerThomas Haller <thaller@redhat.com>2015-03-20 11:43:30 +0100
commit0587dbe96c977787188f03bb2b7a60169fdc05bc (patch)
tree87b3f1854b7c1d5109f3a4d78f8eca0d2b2449a5
parent12ad2c7fe7ebd94c40edd9a28b81ce27563bb2e3 (diff)
downloadNetworkManager-0587dbe96c977787188f03bb2b7a60169fdc05bc.tar.gz
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.
-rw-r--r--src/main.c8
-rw-r--r--src/nm-iface-helper.c8
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 */