]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
signal: Avoid system signal disposition to interfere with tests
authorAdhemerval Zanella <adhemerval.zanella@linaro.org>
Wed, 14 Feb 2024 17:33:41 +0000 (17:33 +0000)
committerAdhemerval Zanella <adhemerval.zanella@linaro.org>
Wed, 27 Mar 2024 16:47:09 +0000 (13:47 -0300)
Both tst-sigset2 and tst-signal1 expectes that SIGINT disposition
is set to SIG_DFL.

signal/tst-sigset2.c
sysdeps/pthread/tst-signal1.c

index 4eef653f955f59b5e35ec37d3460baafb250f0b5..c1d125e4cbed1f0404252d7136c54672ca4fb668 100644 (file)
@@ -11,6 +11,8 @@
 #include <sys/wait.h>
 #include <libc-diag.h>
 
+#include <support/xsignal.h>
+
 /* The sigset function is deprecated.  */
 DIAG_IGNORE_NEEDS_COMMENT (4.9, "-Wdeprecated-declarations");
 
@@ -148,6 +150,8 @@ returnTest3 (void)
 int
 main (int argc, char *argv[])
 {
+  xsignal (TEST_SIG, SIG_DFL);
+
   pid_t childPid;
 
   childPid = fork();
index 1c550ef8ebc30f2c7076c5dad69e3677f77705a8..ca145eef3d8e4fdf5932bcaa41e9019367092536 100644 (file)
@@ -26,6 +26,7 @@
 #include <sys/wait.h>
 
 #include <support/xunistd.h>
+#include <support/xsignal.h>
 
 static sigset_t ss;
 static pthread_barrier_t *b;
@@ -93,6 +94,8 @@ receiver (void)
 static int
 do_test (void)
 {
+  xsignal (SIGINT, SIG_DFL);
+
   char tmp[] = "/tmp/tst-signal1-XXXXXX";
 
   int fd = mkstemp (tmp);