diff options
author | Tom Fitzhenry <tom@tom-fitzhenry.me.uk> | 2020-04-13 02:04:25 +1000 |
---|---|---|
committer | Tom Fitzhenry <tom@tom-fitzhenry.me.uk> | 2020-04-22 01:25:08 +1000 |
commit | de1e61f7cd50cbd1a99777fe6611642a51abf5f6 (patch) | |
tree | b1d67019e7c964608c89022277e75a5504b462d8 /src/gui/curses/gui-curses-main.c | |
parent | 60b75f4677dc9b89fb3e3153d681e66d842c8998 (diff) | |
download | weechat-de1e61f7cd50cbd1a99777fe6611642a51abf5f6.zip |
core: reload config on SIGHUP
fixes https://github.com/weechat/weechat/issues/1476
Diffstat (limited to 'src/gui/curses/gui-curses-main.c')
-rw-r--r-- | src/gui/curses/gui-curses-main.c | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/src/gui/curses/gui-curses-main.c b/src/gui/curses/gui-curses-main.c index 7907b9497..a62074703 100644 --- a/src/gui/curses/gui-curses-main.c +++ b/src/gui/curses/gui-curses-main.c @@ -320,6 +320,18 @@ gui_main_handle_quit_signals () } /* + * Callback for signals received that will make WeeChat reload. + */ + +void +gui_main_handle_reload_signal () +{ + log_printf ("Signal SIGHUP received, reloading WeeChat configuration..."); + command_reload_files (); + weechat_reload_signal = 0; +} + +/* * Displays infos about ncurses lib. */ @@ -513,6 +525,9 @@ gui_main_loop () /* handle signals received */ if (weechat_quit_signal > 0) gui_main_handle_quit_signals (); + + if (weechat_reload_signal > 0) + gui_main_handle_reload_signal (); } /* remove keyboard hook */ |