[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
- [PATCH 00/15] Hurd signals: please review, Jeremie Koenig, 2011/06/29
- [PATCH 01/15] _hurd_internal_post_signal: Split into more functions, Jeremie Koenig, 2011/06/29
- [PATCH 02/15] _hurd_internal_post_signal: Scope variables more restrictively, Jeremie Koenig, 2011/06/29
- [PATCH 06/15] Hurd signals: make sigsuspend POSIX-conformant., Jeremie Koenig, 2011/06/29
- [PATCH 05/15] Hurd signals: reindent, Jeremie Koenig, 2011/06/29
- [PATCH 08/15] Versions.def: add GLIBC_2.15, Jeremie Koenig, 2011/06/29
- [PATCH 10/15] Hurd signals: provide a sigstate destructor, Jeremie Koenig, 2011/06/29
- [PATCH 11/15] Hurd signals: fix sigwait() for global signals,
Jeremie Koenig <=
- [PATCH 14/15] Hurd signals: SA_SIGINFO support, Jeremie Koenig, 2011/06/29
- [PATCH 13/15] Hurd signals: Copy bits/sigaction.h, Jeremie Koenig, 2011/06/29
- [PATCH 07/15] Hurd signals: fix uninitialized value., Jeremie Koenig, 2011/06/29
- [PATCH 04/15] Hurd signals: refactor check_pending_signals, Jeremie Koenig, 2011/06/29
- [PATCH 03/15] _hurd_internal_post_signal: Split out inner functions, Jeremie Koenig, 2011/06/29
- [PATCH 09/15] Hurd signals: implement global signal dispositions, Jeremie Koenig, 2011/06/29
- [PATCH 12/15] Hurd signals: fix global untraced signals., Jeremie Koenig, 2011/06/29
- [PATCH 15/15] Hurd signals: Use POSIX sigcodes, Jeremie Koenig, 2011/06/29