mirror of
https://github.com/weechat/weechat.git
synced 2026-06-26 04:46:37 +02:00
core: quit WeeChat on signal SIGHUP, remove signal "signal_sighup"
This commit is contained in:
@@ -15,6 +15,7 @@ http://weechat.org/files/releasenotes/ReleaseNotes-devel.html[release notes]
|
||||
|
||||
== Version 0.4.4 (under dev)
|
||||
|
||||
* core: quit WeeChat on signal SIGHUP, remove signal "signal_sighup"
|
||||
* core: add text search in buffers with free content (task #13051)
|
||||
* core: add buffer property "clear"
|
||||
* core: fix add of filter on OS X when regex for message is empty (filter regex
|
||||
|
||||
@@ -8155,11 +8155,6 @@ List of signals sent by WeeChat and plugins:
|
||||
String: arguments for /quit |
|
||||
Command `/quit` issued by user
|
||||
|
||||
| weechat | signal_sighup +
|
||||
_(WeeChat ≥ 0.4.3)_ |
|
||||
- |
|
||||
Signal SIGHUP received (WeeChat will reload the configuration files)
|
||||
|
||||
| weechat | signal_sigwinch +
|
||||
_(WeeChat ≥ 0.4.3)_ |
|
||||
- |
|
||||
|
||||
@@ -8296,11 +8296,6 @@ Liste des signaux envoyés par WeeChat et les extensions :
|
||||
Chaîne : paramètres pour le /quit |
|
||||
La commande `/quit` a été exécutée par l'utilisateur
|
||||
|
||||
| weechat | signal_sighup +
|
||||
_(WeeChat ≥ 0.4.3)_ |
|
||||
- |
|
||||
Signal SIGHUP reçu (WeeChat va recharger les fichiers de configuration)
|
||||
|
||||
| weechat | signal_sigwinch +
|
||||
_(WeeChat ≥ 0.4.3)_ |
|
||||
- |
|
||||
|
||||
@@ -8343,12 +8343,6 @@ List of signals sent by WeeChat and plugins:
|
||||
String: argomenti per /quit |
|
||||
Comando `/quit` digitato dall'utente
|
||||
|
||||
// TRANSLATION MISSING
|
||||
| weechat | signal_sighup +
|
||||
_(WeeChat ≥ 0.4.3)_ |
|
||||
- |
|
||||
Signal SIGHUP received (WeeChat will reload the configuration files)
|
||||
|
||||
// TRANSLATION MISSING
|
||||
| weechat | signal_sigwinch +
|
||||
_(WeeChat ≥ 0.4.3)_ |
|
||||
|
||||
@@ -8149,11 +8149,6 @@ WeeChat とプラグインが送信するシグナルのリスト:
|
||||
String: /quit の引数 |
|
||||
ユーザがコマンド `/quit` を実行
|
||||
|
||||
| weechat | signal_sighup +
|
||||
_(WeeChat バージョン 0.4.3 以上で利用可)_ |
|
||||
- |
|
||||
SIGHUP シグナルを受信しました (WeeChat は設定ファイルを再読み込みします)
|
||||
|
||||
| weechat | signal_sigwinch +
|
||||
_(WeeChat バージョン 0.4.3 以上で利用可)_ |
|
||||
- |
|
||||
|
||||
@@ -60,7 +60,6 @@
|
||||
#include "gui-curses.h"
|
||||
|
||||
|
||||
int gui_reload_config = 0; /* 1 if config must be reloaded */
|
||||
int gui_signal_sigwinch_received = 0; /* sigwinch signal (term resized) */
|
||||
int gui_term_cols = 0; /* number of columns in terminal */
|
||||
int gui_term_lines = 0; /* number of lines in terminal */
|
||||
@@ -274,21 +273,16 @@ gui_main_signal_sigterm ()
|
||||
}
|
||||
|
||||
/*
|
||||
* Callback for system signal SIGHUP: reloads WeeChat configuration.
|
||||
* Callback for system signal SIGHUP: quits WeeChat.
|
||||
*/
|
||||
|
||||
void
|
||||
gui_main_signal_sighup ()
|
||||
{
|
||||
/*
|
||||
* SIGHUP signal is received when terminal is closed (exit of WeeChat
|
||||
* without using /quit command), that's why we set only flag to reload
|
||||
* configuration files later (when terminal is closed, config files are NOT
|
||||
* reloaded, but they are if signal SIGHUP is sent to WeeChat by user)
|
||||
*/
|
||||
gui_reload_config = 1;
|
||||
|
||||
(void) hook_signal_send ("signal_sighup", WEECHAT_HOOK_SIGNAL_STRING, NULL);
|
||||
log_printf (_("Signal %s received, exiting WeeChat..."),
|
||||
"SIGHUP");
|
||||
(void) hook_signal_send ("quit", WEECHAT_HOOK_SIGNAL_STRING, NULL);
|
||||
weechat_quit = 1;
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -438,11 +432,9 @@ gui_main_loop ()
|
||||
int max_fd;
|
||||
int ready;
|
||||
|
||||
/* catch SIGTERM signal: quit program */
|
||||
/* catch SIGTERM/SIGQUIT/SIGHUP signals: quit program */
|
||||
util_catch_signal (SIGTERM, &gui_main_signal_sigterm);
|
||||
util_catch_signal (SIGQUIT, &gui_main_signal_sigquit);
|
||||
|
||||
/* catch SIGHUP signal: reload configuration */
|
||||
util_catch_signal (SIGHUP, &gui_main_signal_sighup);
|
||||
|
||||
/* catch SIGWINCH signal: redraw screen */
|
||||
@@ -456,15 +448,6 @@ gui_main_loop ()
|
||||
|
||||
while (!weechat_quit)
|
||||
{
|
||||
/* reload config, if SIGHUP received */
|
||||
if (gui_reload_config)
|
||||
{
|
||||
gui_reload_config = 0;
|
||||
log_printf (_("Signal SIGHUP received, reloading configuration "
|
||||
"files"));
|
||||
command_reload (NULL, NULL, 0, NULL, NULL);
|
||||
}
|
||||
|
||||
/* execute hook timers */
|
||||
hook_timer_exec ();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user