From 6bddf2c83bc7e958bd58a42f007855f49f5eec12 Mon Sep 17 00:00:00 2001 From: ridiculousfish Date: Wed, 20 Feb 2019 17:07:29 -0800 Subject: [PATCH] Add basic signal test --- src/signal.cpp | 1 + tests/signal.err | 0 tests/signal.in | 6 ++++++ tests/signal.out | 1 + 4 files changed, 8 insertions(+) create mode 100644 tests/signal.err create mode 100644 tests/signal.in create mode 100644 tests/signal.out diff --git a/src/signal.cpp b/src/signal.cpp index 8c2886650..d48875cad 100644 --- a/src/signal.cpp +++ b/src/signal.cpp @@ -273,6 +273,7 @@ static void handle_sigalarm(int sig, siginfo_t *info, void *context) { UNUSED(info); UNUSED(context); if (reraise_if_forked_child(sig)) return; + default_handler(sig, info, context); } void signal_reset_handlers() { diff --git a/tests/signal.err b/tests/signal.err new file mode 100644 index 000000000..e69de29bb diff --git a/tests/signal.in b/tests/signal.in new file mode 100644 index 000000000..99dd46697 --- /dev/null +++ b/tests/signal.in @@ -0,0 +1,6 @@ +function alarm --on-signal ALRM + echo ALRM received +end + +kill -s ALRM $fish_pid + diff --git a/tests/signal.out b/tests/signal.out new file mode 100644 index 000000000..c2652b37d --- /dev/null +++ b/tests/signal.out @@ -0,0 +1 @@ +ALRM received