From a5891299b91a3887afd8f9605b0b7c97ee48e107 Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Wed, 11 Mar 2015 08:23:23 -0500 Subject: [PATCH] core: quit if manager startup completed before starting the mainloop --- src/main.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/main.c b/src/main.c index 11ecffca98..3df3e11eb4 100644 --- a/src/main.c +++ b/src/main.c @@ -65,6 +65,7 @@ #define NM_DEFAULT_SYSTEM_STATE_FILE NMSTATEDIR "/NetworkManager.state" static GMainLoop *main_loop = NULL; +static gboolean configure_and_quit = FALSE; static gboolean parse_state_file (const char *filename, @@ -193,6 +194,7 @@ manager_configure_quit (NMManager *manager, gpointer user_data) { nm_log_info (LOGD_CORE, "quitting now that startup is complete"); g_main_loop_quit (main_loop); + configure_and_quit = TRUE; } /* @@ -457,7 +459,8 @@ main (int argc, char *argv[]) success = TRUE; - g_main_loop_run (main_loop); + if (configure_and_quit == FALSE) + g_main_loop_run (main_loop); nm_manager_stop (manager);