changeset 15348:ee3d72d886e6

pselect: Use pthread_sigmask, not sigprocmask. * lib/pselect.c (pselect): Use pthread_sigmask, as it supports multithreaded apps better than sigprocmask does. * modules/pselect (Depends-on): Depend on pthread_sigmask, not sigprocmask directly.
author Paul Eggert <eggert@cs.ucla.edu>
date Wed, 06 Jul 2011 00:05:40 -0700
parents 2080394d2815
children b3eeae7bf93e
files ChangeLog lib/pselect.c modules/pselect
diffstat 3 files changed, 11 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2011-07-06  Paul Eggert  <eggert@cs.ucla.edu>
+
+	pselect: Use pthread_sigmask, not sigprocmask.
+	* lib/pselect.c (pselect): Use pthread_sigmask, as it supports
+	multithreaded apps better than sigprocmask does.
+	* modules/pselect (Depends-on): Depend on pthread_sigmask, not
+	sigprocmask directly.
+
 2011-07-05  Paul Eggert  <eggert@cs.ucla.edu>
 
 	* lib/pselect.c (pselect): Use plain name, without "rpl_".
--- a/lib/pselect.c
+++ b/lib/pselect.c
@@ -62,14 +62,14 @@
   /* Signal mask munging should be atomic, but this is the best we can
      do in this emulation.  */
   if (sigmask)
-    sigprocmask (SIG_SETMASK, sigmask, &origmask);
+    pthread_sigmask (SIG_SETMASK, sigmask, &origmask);
 
   select_result = select (nfds, rfds, wfds, xfds, tvp);
 
   if (sigmask)
     {
       int select_errno = errno;
-      sigprocmask (SIG_SETMASK, &origmask, NULL);
+      pthread_sigmask (SIG_SETMASK, &origmask, NULL);
       errno = select_errno;
     }
 
--- a/modules/pselect
+++ b/modules/pselect
@@ -7,6 +7,7 @@
 
 Depends-on:
 sys_select
+pthread_sigmask [test $HAVE_PSELECT = 0 || test $REPLACE_PSELECT = 1]
 select          [test $HAVE_PSELECT = 0 || test $REPLACE_PSELECT = 1]
 
 configure.ac: