1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51
|
From: Jeremie Koenig <jk@jk.fr.eu.org>
Subject: [PATCH] Small signal fixes
22e7268 Hurd signals: fix sigwait for pending signals
da8bf5e Hurd signals: clear the pending mask in fork and spawn
8e87205 Hurd signals: don't drop blocked ignored signals
---
hurd/hurdsig.c | 4 +---
sysdeps/mach/hurd/fork.c | 4 +++-
sysdeps/mach/hurd/spawni.c | 2 +-
3 files changed, 5 insertions(+), 5 deletions(-)
--- a/hurd/hurdsig.c
+++ b/hurd/hurdsig.c
@@ -861,9 +861,7 @@ post_signal (struct hurd_sigstate *ss,
}
/* Handle receipt of a blocked signal, or any signal while stopped. */
- if (act != ignore && /* Signals ignored now are forgotten now. */
- __sigismember (&blocked, signo) ||
- (signo != SIGKILL && _hurd_stopped))
+ if (__sigismember (&blocked, signo) || (signo != SIGKILL && _hurd_stopped))
{
mark_pending ();
act = ignore;
--- a/sysdeps/mach/hurd/fork.c
+++ b/sysdeps/mach/hurd/fork.c
@@ -672,8 +672,10 @@ __fork (void)
err = __USEPORT (PROC, __proc_getpids (port, &_hurd_pid, &_hurd_ppid,
&_hurd_orphaned));
- /* Forking clears the trace flag. */
+ /* Forking clears the trace flag and pending masks. */
__sigemptyset (&_hurdsig_traced);
+ __sigemptyset (&_hurd_global_sigstate->pending);
+ __sigemptyset (&ss->pending);
/* Release malloc locks. */
__malloc_fork_unlock_child ();
--- a/sysdeps/mach/hurd/spawni.c
+++ b/sysdeps/mach/hurd/spawni.c
@@ -239,7 +239,7 @@ __spawni (pid_t *pid, const char *file,
_hurd_sigstate_lock (ss);
ints[INIT_SIGMASK] = ss->blocked;
- ints[INIT_SIGPENDING] = _hurd_sigstate_pending (ss); /* XXX really? */
+ ints[INIT_SIGPENDING] = 0;
ints[INIT_SIGIGN] = 0;
/* Unless we were asked to reset all handlers to SIG_DFL,
pass down the set of signals that were set to SIG_IGN. */
|