commit 82d46804143bc0de7bb9acd728cb951a78112af4 parent 727b2a5236346e75ec6455179d5073e348d165be Author: Érico Nogueira <erico.erc@gmail.com> Date: Fri, 27 Aug 2021 22:51:31 -0300 sig: use const for sig_* constants and add sig_kill. Diffstat:
M | src/sig.c | | | 15 | ++++++++------- |
M | src/sig.h | | | 15 | ++++++++------- |
2 files changed, 16 insertions(+), 14 deletions(-)
diff --git a/src/sig.c b/src/sig.c @@ -3,13 +3,14 @@ #include <signal.h> #include "sig.h" -int sig_alarm = SIGALRM; -int sig_child = SIGCHLD; -int sig_cont = SIGCONT; -int sig_hangup = SIGHUP; -int sig_int = SIGINT; -int sig_pipe = SIGPIPE; -int sig_term = SIGTERM; +const int sig_alarm = SIGALRM; +const int sig_child = SIGCHLD; +const int sig_cont = SIGCONT; +const int sig_hangup = SIGHUP; +const int sig_int = SIGINT; +const int sig_kill = SIGKILL; +const int sig_pipe = SIGPIPE; +const int sig_term = SIGTERM; void (*sig_defaulthandler)() = SIG_DFL; void (*sig_ignorehandler)() = SIG_IGN; diff --git a/src/sig.h b/src/sig.h @@ -3,13 +3,14 @@ #ifndef SIG_H #define SIG_H -extern int sig_alarm; -extern int sig_child; -extern int sig_cont; -extern int sig_hangup; -extern int sig_int; -extern int sig_pipe; -extern int sig_term; +extern const int sig_alarm; +extern const int sig_child; +extern const int sig_cont; +extern const int sig_hangup; +extern const int sig_int; +extern const int sig_kill; +extern const int sig_pipe; +extern const int sig_term; extern void (*sig_defaulthandler)(); extern void (*sig_ignorehandler)();