bug-hurd
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


From: Jeremie Koenig
Subject: [PATCH 11/15] Hurd signals: fix sigwait() for global signals
Date: Wed, 29 Jun 2011 18:30:23 +0200

* 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




reply via email to

[Prev in Thread] Current Thread [Next in Thread]