This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
[PATCH 11/15] Hurd signals: fix sigwait() for global signals
- From: Jeremie Koenig <jk at jk dot fr dot eu dot org>
- To: libc-alpha at sourceware dot org
- Cc: Jeremie Koenig <jk at jk dot fr dot eu dot org>,bug-hurd at gnu dot org,Roland McGrath <roland at hack dot frob dot com>
- Date: Wed, 29 Jun 2011 18:30:23 +0200
- Subject: [PATCH 11/15] Hurd signals: fix sigwait() for global signals
- References: <1309365027-4774-1-git-send-email-jk@jk.fr.eu.org>
* 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