public inbox for libc-hacker@sourceware.org
 help / color / mirror / Atom feed
* Fix misc/tst-pselect.c
@ 2006-01-21 10:57 Andreas Jaeger
  2006-01-21 19:35 ` Roland McGrath
  2006-01-21 19:47 ` Ulrich Drepper
  0 siblings, 2 replies; 3+ messages in thread
From: Andreas Jaeger @ 2006-01-21 10:57 UTC (permalink / raw)
  To: Glibc hackers

[-- 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 --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Fix misc/tst-pselect.c
  2006-01-21 10:57 Fix misc/tst-pselect.c Andreas Jaeger
@ 2006-01-21 19:35 ` Roland McGrath
  2006-01-21 19:47 ` Ulrich Drepper
  1 sibling, 0 replies; 3+ messages in thread
From: Roland McGrath @ 2006-01-21 19:35 UTC (permalink / raw)
  To: Andreas Jaeger; +Cc: Glibc hackers

That looks fine to me.

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Fix misc/tst-pselect.c
  2006-01-21 10:57 Fix misc/tst-pselect.c Andreas Jaeger
  2006-01-21 19:35 ` Roland McGrath
@ 2006-01-21 19:47 ` Ulrich Drepper
  1 sibling, 0 replies; 3+ messages in thread
From: Ulrich Drepper @ 2006-01-21 19:47 UTC (permalink / raw)
  To: Andreas Jaeger; +Cc: Glibc hackers

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

Andreas Jaeger wrote:
> Here's a fix which also avoids using sigblock.  

I deliberately used sigblock because we don't test it elsewhere.

-- 
➧ Ulrich Drepper ➧ Red Hat, Inc. ➧ 444 Castro St ➧ Mountain View, CA ❖


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 251 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2006-01-21 19:47 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-01-21 10:57 Fix misc/tst-pselect.c Andreas Jaeger
2006-01-21 19:35 ` Roland McGrath
2006-01-21 19:47 ` Ulrich Drepper

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).