diff mbox

Avoid deprecated sigblock in misc/tst-pselect.c

Message ID alpine.DEB.2.10.1411261656330.854@digraph.polyomino.org.uk
State New
Headers show

Commit Message

Joseph Myers Nov. 26, 2014, 4:57 p.m. UTC
misc/tst-pselect.c uses the deprecated sigblock interface, resulting
in "tst-pselect.c:42:3: warning: 'sigblock' is deprecated (declared at
../signal/signal.h:189) [-Wdeprecated-declarations]".  The choice of
sigblock rather than sigprocmask has nothing to do with what this test
is testing, so this patch changes it to use sigprocmask to avoid the
warning.

Tested for x86_64.

2014-11-26  Joseph Myers  <joseph@codesourcery.com>

	* misc/tst-pselect.c (do_test): Use sigprocmask instead of
	sigblock.

Comments

Ondřej Bílka Nov. 27, 2014, 4 p.m. UTC | #1
On Wed, Nov 26, 2014 at 04:57:12PM +0000, Joseph Myers wrote:
> misc/tst-pselect.c uses the deprecated sigblock interface, resulting
> in "tst-pselect.c:42:3: warning: 'sigblock' is deprecated (declared at
> ../signal/signal.h:189) [-Wdeprecated-declarations]".  The choice of
> sigblock rather than sigprocmask has nothing to do with what this test
> is testing, so this patch changes it to use sigprocmask to avoid the
> warning.
> 
> Tested for x86_64.
>
looks ok.
diff mbox

Patch

diff --git a/misc/tst-pselect.c b/misc/tst-pselect.c
index 36bc46d..095d794 100644
--- a/misc/tst-pselect.c
+++ b/misc/tst-pselect.c
@@ -39,9 +39,12 @@  do_test (void)
       return 1;
     }
 
-  if (sigblock (sigmask (SIGUSR1)) != 0)
+  sigset_t ss_usr1;
+  sigemptyset (&ss_usr1);
+  sigaddset (&ss_usr1, SIGUSR1);
+  if (sigprocmask (SIG_BLOCK, &ss_usr1, NULL) != 0)
     {
-      puts ("sigblock failed");
+      puts ("sigprocmask failed");
       return 1;
     }