Avoid test failure on glibc with LinuxThreads.
authorBruno Haible <bruno@clisp.org>
Sun, 28 Sep 2008 14:04:07 +0000 (16:04 +0200)
committerBruno Haible <bruno@clisp.org>
Sun, 28 Sep 2008 14:04:07 +0000 (16:04 +0200)
ChangeLog
tests/test-sigaction.c

index 6cec4e972adf2a9054ca016f341643a453345690..a4204715c20b0f32c7460368d0c6aeae6ed1e351 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2008-09-28  Bruno Haible  <bruno@clisp.org>
+
+       * tests/test-sigaction.c (handler, main): Disable the check whether
+       SA_RESETHAND has reverted the installed handler to SIG_DFL. Needed on
+       glibc systems with LinuxThreads.
+
 2008-09-28  Bruno Haible  <bruno@clisp.org>
 
        * doc/posix-functions/freopen.texi: Mention the trailing slash problem.
index 30c4744d1d96dd0ba7489522becbb388df823761..c06e6f72772e1a14196d999a2e191c1e36666ad9 100644 (file)
@@ -76,7 +76,12 @@ handler (int sig)
       ASSERT (sa.sa_handler == handler);
       break;
     case 1:
+      /* This assertion fails on glibc-2.3.6 systems with LinuxThreads,
+        when this program is linked with -lpthread, due to the sigaction()
+        override in libpthread.so.  */
+#if !defined __GLIBC__
       ASSERT (sa.sa_handler == SIG_DFL);
+#endif
       break;
     default:
       ASSERT (0);
@@ -89,24 +94,31 @@ main (int argc, char *argv[])
   struct sigaction sa;
   struct sigaction old_sa;
   sa.sa_handler = handler;
+
   sa.sa_flags = 0;
   ASSERT (sigemptyset (&sa.sa_mask) == 0);
   ASSERT (sigaction (SIGABRT, &sa, NULL) == 0);
   ASSERT (raise (SIGABRT) == 0);
+
   sa.sa_flags = SA_RESETHAND | SA_NODEFER;
   ASSERT (sigaction (SIGABRT, &sa, &old_sa) == 0);
   ASSERT ((old_sa.sa_flags & MASK_SA_FLAGS) == 0);
   ASSERT (old_sa.sa_handler == handler);
   ASSERT (raise (SIGABRT) == 0);
+
   sa.sa_handler = SIG_DFL;
   ASSERT (sigaction (SIGABRT, &sa, &old_sa) == 0);
   ASSERT ((old_sa.sa_flags & SA_SIGINFO) == 0);
+#if !defined __GLIBC__ /* see above */
   ASSERT (old_sa.sa_handler == SIG_DFL);
+#endif
+
   sa.sa_handler = SIG_IGN;
   ASSERT (sigaction (SIGABRT, &sa, NULL) == 0);
   ASSERT (raise (SIGABRT) == 0);
   ASSERT (sigaction (SIGABRT, NULL, &old_sa) == 0);
   ASSERT (old_sa.sa_handler == SIG_IGN);
   ASSERT (raise (SIGABRT) == 0);
+
   return 0;
 }