mirror of
https://github.com/fish-shell/fish-shell
synced 2025-01-13 13:39:02 +00:00
Add a SIGALRM handler that does nothing
This will be part of a future signal torture-test, to ensure we are handling EINTR correctly
This commit is contained in:
parent
7e3db843cd
commit
d8a6c0a91b
1 changed files with 14 additions and 0 deletions
|
@ -242,6 +242,15 @@ static void handle_chld(int sig, siginfo_t *info, void *context) {
|
|||
default_handler(sig, info, context);
|
||||
}
|
||||
|
||||
// We have a sigalarm handler that does nothing
|
||||
// This is used in the signal torture test, to verify
|
||||
// that we behave correctly when receiving lots of irrelevant signals
|
||||
static void handle_sigalarm(int sig, siginfo_t *info, void *context) {
|
||||
UNUSED(sig);
|
||||
UNUSED(info);
|
||||
UNUSED(context);
|
||||
}
|
||||
|
||||
void signal_reset_handlers() {
|
||||
int i;
|
||||
|
||||
|
@ -285,6 +294,11 @@ static void set_interactive_handlers() {
|
|||
act.sa_flags = SA_SIGINFO;
|
||||
sigaction(SIGHUP, &act, 0);
|
||||
|
||||
// SIGALARM as part of our signal torture test
|
||||
act.sa_sigaction = &handle_sigalarm;
|
||||
act.sa_flags = SA_SIGINFO;
|
||||
sigaction(SIGALRM, &act, 0);
|
||||
|
||||
#ifdef SIGWINCH
|
||||
act.sa_sigaction = &handle_winch;
|
||||
act.sa_flags = SA_SIGINFO;
|
||||
|
|
Loading…
Reference in a new issue