]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
Use signal rather than sigaction in nptl/tst-cleanup2.
authorRoland McGrath <roland@hack.frob.com>
Fri, 6 Feb 2015 20:30:05 +0000 (12:30 -0800)
committerRoland McGrath <roland@hack.frob.com>
Fri, 6 Feb 2015 20:30:05 +0000 (12:30 -0800)
ChangeLog
nptl/tst-cleanup2.c

index fa82cfa2df99d1818600d0f26581ddcbfb100be4..bcd964b7086ade9dcd21c96240c32751357ad965 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,8 @@
 2015-02-06  Roland McGrath  <roland@hack.frob.com>
 
+       * nptl/tst-cleanup2.c (do_test): Use signal rather than sigaction.
+       Drop trailing \n from perror argument.  Use return rather than exit.
+
        * nptl/tst-cancel20.c (do_test): Conditionalize SA_SIGINFO-using tests
        on [SA_SIGINFO].
        * nptl/tst-cancel21.c (do_test): Likewise.
index 8a524de8695e94fdc4d325dd54c83c47a2209f51..9e5a9570a470df5404310f8033acdf94ea9a435b 100644 (file)
@@ -40,16 +40,11 @@ do_test (void)
      array.  Mark the return value as volatile so that it gets reloaded on
      return.  */
   volatile int ret = 0;
-  struct sigaction sa;
 
-  sa.sa_handler = sig_handler;
-  sigemptyset (&sa.sa_mask);
-  sa.sa_flags = SA_SIGINFO;
-
-  if (sigaction (SIGSEGV, &sa, 0))
+  if (signal (SIGSEGV, &sig_handler) == SIG_ERR)
     {
-      perror ("installing SIGSEGV handler\n");
-      exit (1);
+      perror ("installing SIGSEGV handler");
+      return 1;
     }
 
   puts ("Attempting to sprintf to null ptr");