mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2025-12-29 04:30:09 +01:00
core: create GMainLoop after daemonizing
The GMainLoop instance (and the default GMainContext singleton) is not required for trivial operations like --print-config, --version or --help). If running as SysV daemon, the event file descriptor is unnecessarily dup'ed from the parent to the child process. Signed-off-by: Christian Eggers <ceggers@arri.de> https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/1160
This commit is contained in:
parent
866a28e585
commit
f6ec6ef364
1 changed files with 2 additions and 2 deletions
|
|
@ -302,8 +302,6 @@ main(int argc, char *argv[])
|
|||
g_type_ensure(G_TYPE_DBUS_CONNECTION);
|
||||
g_type_ensure(NM_TYPE_DBUS_MANAGER);
|
||||
|
||||
main_loop = g_main_loop_new(NULL, FALSE);
|
||||
|
||||
/* we determine a first-start (contrary to a restart during the same boot)
|
||||
* based on the existence of NM_CONFIG_DEVICE_STATE_DIR directory. */
|
||||
config_cli = nm_config_cmd_line_options_new(
|
||||
|
|
@ -403,6 +401,8 @@ main(int argc, char *argv[])
|
|||
wrote_pidfile = nm_main_utils_write_pidfile(global_opt.pidfile);
|
||||
}
|
||||
|
||||
main_loop = g_main_loop_new(NULL, FALSE);
|
||||
|
||||
/* Set up unix signal handling - before creating threads, but after daemonizing! */
|
||||
nm_main_utils_setup_signals(main_loop);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue