summaryrefslogtreecommitdiff
path: root/src/core/weechat.c
diff options
context:
space:
mode:
authorSébastien Helleu <flashcode@flashtux.org>2015-05-01 08:33:52 +0200
committerSébastien Helleu <flashcode@flashtux.org>2015-05-01 08:33:52 +0200
commitd8d44d6138f3cebf551e2c19710846905ce00cd9 (patch)
treebabaf2d7cba38f70b288f08d0b668e1f01f3b440 /src/core/weechat.c
parent71dd64678c4e206ca6b713a1323785124116f38d (diff)
downloadweechat-d8d44d6138f3cebf551e2c19710846905ce00cd9.zip
core: add signals "signal_sigterm" and "signal_sigquit" (closes #114)
Diffstat (limited to 'src/core/weechat.c')
-rw-r--r--src/core/weechat.c26
1 files changed, 20 insertions, 6 deletions
diff --git a/src/core/weechat.c b/src/core/weechat.c
index 464a769a8..23619fa3e 100644
--- a/src/core/weechat.c
+++ b/src/core/weechat.c
@@ -521,9 +521,16 @@ weechat_sighup ()
void
weechat_sigquit ()
{
- log_printf (_("Signal %s received, exiting WeeChat..."), "SIGQUIT");
- (void) hook_signal_send ("quit", WEECHAT_HOOK_SIGNAL_STRING, NULL);
- weechat_quit = 1;
+ int rc;
+
+ rc = hook_signal_send ("signal_sigquit",
+ WEECHAT_HOOK_SIGNAL_STRING, NULL);
+ if (rc != WEECHAT_RC_OK_EAT)
+ {
+ log_printf (_("Signal %s received, exiting WeeChat..."), "SIGQUIT");
+ (void) hook_signal_send ("quit", WEECHAT_HOOK_SIGNAL_STRING, NULL);
+ weechat_quit = 1;
+ }
}
/*
@@ -533,9 +540,16 @@ weechat_sigquit ()
void
weechat_sigterm ()
{
- log_printf (_("Signal %s received, exiting WeeChat..."), "SIGTERM");
- (void) hook_signal_send ("quit", WEECHAT_HOOK_SIGNAL_STRING, NULL);
- weechat_quit = 1;
+ int rc;
+
+ rc = hook_signal_send ("signal_sigterm",
+ WEECHAT_HOOK_SIGNAL_STRING, NULL);
+ if (rc != WEECHAT_RC_OK_EAT)
+ {
+ log_printf (_("Signal %s received, exiting WeeChat..."), "SIGTERM");
+ (void) hook_signal_send ("quit", WEECHAT_HOOK_SIGNAL_STRING, NULL);
+ weechat_quit = 1;
+ }
}
/*