commit bd91a54a73aaef0b5ca572d3459f66a0b645414d
parent ea15f9b31bb39a1304f6217adfdb0fdd629518e9
Author: Roberto E. Vargas Caballero <k0ga@shike2.net>
Date: Fri, 24 Apr 2026 19:00:48 +0200
tests/libc: Accept SIG_IGN for SIGINT
Depending of the configuration of the shell and/or terminal the
initial handler of thesignal cam be SIG_DFL or SIG_IGN.
Diffstat:
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/tests/libc/execute/0007-signal.c b/tests/libc/execute/0007-signal.c
@@ -69,10 +69,14 @@ handler2(int sig)
void
test1()
{
+ void (*shdl)(int);
+
puts("test 1");
assert(signal(SIGABRT, handler1) == SIG_DFL);
assert(signal(SIGFPE, handler1) == SIG_DFL);
- assert(signal(SIGINT, handler1) == SIG_DFL);
+
+ shdl = signal(SIGINT, handler1);
+ assert(shdl == SIG_DFL || shdl == SIG_IGN);
assert(signal(SIGSEGV, handler1) == SIG_DFL);
assert(signal(SIGTERM, handler1) == SIG_DFL);
}