From: GNU Libc Maintainers Date: Tue, 5 May 2020 18:12:38 +0000 (+0100) Subject: git-hurdsig-fixes-2 X-Git-Tag: archive/raspbian/2.30-7+rpi1^2~86 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=d225bde7ba2b19898ecdb5eee724c422b5d151a2;p=glibc.git git-hurdsig-fixes-2 Committed for glibc 2.31 From: Jeremie Koenig 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 Gbp-Pq: Topic hurd-i386 Gbp-Pq: Name git-hurdsig-fixes-2.diff --- diff --git a/hurd/hurdsig.c b/hurd/hurdsig.c index df6ba5815..5decf842a 100644 --- a/hurd/hurdsig.c +++ b/hurd/hurdsig.c @@ -871,9 +871,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; diff --git a/sysdeps/mach/hurd/fork.c b/sysdeps/mach/hurd/fork.c index 2dd92f508..fc48375eb 100644 --- a/sysdeps/mach/hurd/fork.c +++ b/sysdeps/mach/hurd/fork.c @@ -657,8 +657,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. */ _hurd_malloc_fork_child (); diff --git a/sysdeps/mach/hurd/spawni.c b/sysdeps/mach/hurd/spawni.c index 8415ef55f..e86b88fe4 100644 --- a/sysdeps/mach/hurd/spawni.c +++ b/sysdeps/mach/hurd/spawni.c @@ -337,7 +337,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. */