config: pass signals to nm_config_reload()

Also react on SIGUSR1 and SIGUSR2, beside SIGHUP.
Only for SIGHUP actually reload the configuration from
disc. For the other signals only emit a config-changed
signal.
This commit is contained in:
Thomas Haller
2015-06-25 21:10:32 +02:00
parent c2754ede5c
commit caed15e082
7 changed files with 77 additions and 29 deletions

View File

@@ -44,7 +44,7 @@
static gboolean
sighup_handler (gpointer user_data)
{
nm_main_config_reload ();
nm_main_config_reload (GPOINTER_TO_INT (user_data));
return G_SOURCE_CONTINUE;
}
@@ -83,7 +83,9 @@ nm_main_utils_setup_signals (GMainLoop *main_loop)
signal (SIGPIPE, SIG_IGN);
g_unix_signal_add (SIGHUP, sighup_handler, NULL);
g_unix_signal_add (SIGHUP, sighup_handler, GINT_TO_POINTER (SIGHUP));
g_unix_signal_add (SIGUSR1, sighup_handler, GINT_TO_POINTER (SIGUSR1));
g_unix_signal_add (SIGUSR2, sighup_handler, GINT_TO_POINTER (SIGUSR2));
g_unix_signal_add (SIGINT, sigint_handler, main_loop);
g_unix_signal_add (SIGTERM, sigterm_handler, main_loop);
}