Teach fish_test_helper to sigint_self

Preparation for more tests around signals.
This commit is contained in:
ridiculousfish 2022-05-28 16:08:17 -07:00
parent 79255dfe9b
commit d88bee3a57

View File

@ -156,6 +156,11 @@ static void sigkill_self() {
abort();
}
static void sigint_self() {
kill(getpid(), SIGINT);
abort();
}
static void stdin_make_nonblocking() {
const int fd = STDIN_FILENO;
// Catch SIGCONT so pause() wakes us up.
@ -203,6 +208,7 @@ static fth_command_t s_commands[] = {
{"print_ignored_signals", print_ignored_signals,
"Print to stdout the name(s) of ignored signals"},
{"print_stop_cont", print_stop_cont, "Print when we get SIGTSTP and SIGCONT, exiting on input"},
{"sigint_self", sigint_self, "Send SIGINT to self"},
{"sigkill_self", sigkill_self, "Send SIGKILL to self"},
{"stdin_make_nonblocking", stdin_make_nonblocking,
"Print if stdin is blocking and then make it nonblocking"},