This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH 11/15] Hurd signals: fix sigwait() for global signals


* sysdeps/mach/hurd/sigwait.c (__sigwait): Change the blocking mask
temporarily so that we catch global as well as thread-specific signals.
---
 sysdeps/mach/hurd/sigwait.c |   12 +++++++++---
 1 files changed, 9 insertions(+), 3 deletions(-)

diff --git a/sysdeps/mach/hurd/sigwait.c b/sysdeps/mach/hurd/sigwait.c
index fb0c4da..3f9ebc1 100644
--- a/sysdeps/mach/hurd/sigwait.c
+++ b/sysdeps/mach/hurd/sigwait.c
@@ -50,9 +50,6 @@ __sigwait (const sigset_t *set, int *sig)
       /* Make sure this is all kosher */
       assert (__sigismember (&mask, signo));
 
-      /* Make sure this signal is unblocked */
-      __sigdelset (&ss->blocked, signo);
-
       return pe->handler;
     }
 
@@ -91,6 +88,8 @@ __sigwait (const sigset_t *set, int *sig)
 
   /* Wait for one of them to show up.  */
 
+  sigset_t blocked = 0;
+
   if (!setjmp (buf))
     {
       /* Make the preemptor */
@@ -104,6 +103,10 @@ __sigwait (const sigset_t *set, int *sig)
       preemptor.next = ss->preemptors;
       ss->preemptors = &preemptor;
 
+      /* Unblock the expected signals */
+      blocked = ss->blocked;
+      ss->blocked &= ~mask;
+
       _hurd_sigstate_unlock (ss);
 
       /* Wait. */
@@ -120,6 +123,9 @@ __sigwait (const sigset_t *set, int *sig)
       /* Delete our preemptor. */
       assert (ss->preemptors == &preemptor);
       ss->preemptors = preemptor.next;
+
+      /* Restore the blocking mask. */
+      ss->blocked = blocked;
     }
 
 
-- 
1.7.5.3


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]