public inbox for libc-hacker@sourceware.org
 help / color / mirror / Atom feed
From: Andreas Jaeger <aj@suse.de>
To: Glibc hackers <libc-hacker@sources.redhat.com>
Subject: Fix misc/tst-pselect.c
Date: Sat, 21 Jan 2006 10:57:00 -0000	[thread overview]
Message-ID: <m3vewdhmrk.fsf@gromit.moeb> (raw)

[-- Attachment #1: Type: text/plain, Size: 2197 bytes --]


The testcase fails to build with:
tst-pselect.c: In function ‘do_test’:
tst-pselect.c:31: warning: ‘sigblock’ is deprecated (declared at ../signal/signal.h:181)
tst-pselect.c:39: warning: implicit declaration of function ‘pipe’
tst-pselect.c:54: warning: implicit declaration of function ‘fork’
tst-pselect.c:57: warning: implicit declaration of function ‘close’
tst-pselect.c:81: warning: implicit declaration of function ‘TEMP_FAILURE_RETRY’
tst-pselect.c:81: warning: implicit declaration of function ‘write’
In file included from ../include/unistd.h:2,
                 from ../test-skeleton.c:29,
                 from tst-pselect.c:120:
../posix/unistd.h: At top level:
../posix/unistd.h:331: error: conflicting types for ‘write’
tst-pselect.c:81: error: previous implicit declaration of ‘write’ was here
make[2]: *** [/builds/glibc/10.0-nptl/misc/tst-pselect.o] Error 1

Here's a fix which also avoids using sigblock.  

Ok to commit?

Andreas

2006-01-21  Andreas Jaeger  <aj@suse.de>

	* misc/tst-pselect.c: Include <unistd.h> for prototypes.
	(do_test): Use sigprocmask instead of sigblock.

============================================================
Index: misc/tst-pselect.c
--- misc/tst-pselect.c	21 Jan 2006 08:16:28 -0000	1.1
+++ misc/tst-pselect.c	21 Jan 2006 10:56:22 -0000
@@ -3,6 +3,7 @@
 #include <stdio.h>
 #include <sys/select.h>
 #include <sys/wait.h>
+#include <unistd.h>
 
 
 static volatile int handler_called;
@@ -21,6 +22,7 @@ do_test (void)
   sa.sa_handler = handler;
   sa.sa_flags = 0;
   sigemptyset (&sa.sa_mask);
+  sigset_t signalset;
 
   if (sigaction (SIGUSR1, &sa, NULL) != 0)
     {
@@ -28,7 +30,10 @@ do_test (void)
       return 1;
     }
 
-  if (sigblock (SIGUSR1) != 0)
+  sigemptyset (&signalset);
+  sigaddset (&signalset, SIGUSR1);
+
+  if (sigprocmask (SIG_BLOCK, &signalset, NULL) != 0)
     {
       puts ("sigblock failed");
       return 1;

-- 
 Andreas Jaeger, aj@suse.de, http://www.suse.de/~aj/
  SUSE Linux Products GmbH, Maxfeldstr. 5, 90409 Nürnberg, Germany
   GPG fingerprint = 93A3 365E CE47 B889 DF7F  FED1 389A 563C C272 A126

[-- Attachment #2: Type: application/pgp-signature, Size: 188 bytes --]

             reply	other threads:[~2006-01-21 10:57 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-01-21 10:57 Andreas Jaeger [this message]
2006-01-21 19:35 ` Roland McGrath
2006-01-21 19:47 ` Ulrich Drepper

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=m3vewdhmrk.fsf@gromit.moeb \
    --to=aj@suse.de \
    --cc=libc-hacker@sources.redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).