summaryrefslogtreecommitdiff
path: root/src/core/core.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/core/core.c')
-rw-r--r--src/core/core.c14
1 files changed, 12 insertions, 2 deletions
diff --git a/src/core/core.c b/src/core/core.c
index 041d75a4..b11064cb 100644
--- a/src/core/core.c
+++ b/src/core/core.c
@@ -59,6 +59,7 @@ void log_away_deinit(void);
int irssi_gui;
int irssi_init_finished;
+int reload_config;
static char *irssi_dir, *irssi_config_file;
static GSList *dialog_type_queue, *dialog_text_queue;
@@ -74,15 +75,20 @@ const char *get_irssi_config(void)
return irssi_config_file;
}
+static void sig_reload_config(int signo)
+{
+ reload_config = TRUE;
+}
+
static void read_settings(void)
{
#ifndef WIN32
static int signals[] = {
- SIGHUP, SIGINT, SIGQUIT, SIGTERM,
+ SIGINT, SIGQUIT, SIGTERM,
SIGALRM, SIGUSR1, SIGUSR2
};
static char *signames[] = {
- "hup", "int", "quit", "term",
+ "int", "quit", "term",
"alrm", "usr1", "usr2"
};
@@ -95,6 +101,10 @@ static void read_settings(void)
sigemptyset (&act.sa_mask);
act.sa_flags = 0;
+ /* reload config on SIGHUP */
+ act.sa_handler = sig_reload_config;
+ sigaction(SIGHUP, &act, NULL);
+
for (n = 0; n < sizeof(signals)/sizeof(signals[0]); n++) {
act.sa_handler = find_substr(ignores, signames[n]) ?
SIG_IGN : SIG_DFL;