25845f
commit 6b5189eb2000761cd68c3c54c0d03357a9aaec67
25845f
Author: Joseph Myers <joseph@codesourcery.com>
25845f
Date:   Thu Nov 27 16:02:26 2014 +0000
25845f
25845f
    Avoid deprecated sigblock in misc/tst-pselect.c.
25845f
    
25845f
    misc/tst-pselect.c uses the deprecated sigblock interface, resulting
25845f
    in "tst-pselect.c:42:3: warning: 'sigblock' is deprecated (declared at
25845f
    ../signal/signal.h:189) [-Wdeprecated-declarations]".  The choice of
25845f
    sigblock rather than sigprocmask has nothing to do with what this test
25845f
    is testing, so this patch changes it to use sigprocmask to avoid the
25845f
    warning.
25845f
    
25845f
    Tested for x86_64.
25845f
    
25845f
            * misc/tst-pselect.c (do_test): Use sigprocmask instead of
25845f
            sigblock.
25845f
25845f
diff --git a/misc/tst-pselect.c b/misc/tst-pselect.c
25845f
index 36bc46da6c94174a..095d794cb2735e18 100644
25845f
--- a/misc/tst-pselect.c
25845f
+++ b/misc/tst-pselect.c
25845f
@@ -39,9 +39,12 @@ do_test (void)
25845f
       return 1;
25845f
     }
25845f
 
25845f
-  if (sigblock (sigmask (SIGUSR1)) != 0)
25845f
+  sigset_t ss_usr1;
25845f
+  sigemptyset (&ss_usr1);
25845f
+  sigaddset (&ss_usr1, SIGUSR1);
25845f
+  if (sigprocmask (SIG_BLOCK, &ss_usr1, NULL) != 0)
25845f
     {
25845f
-      puts ("sigblock failed");
25845f
+      puts ("sigprocmask failed");
25845f
       return 1;
25845f
     }
25845f