[PATCH] Small signal fixes
authorJeremie Koenig <jk@jk.fr.eu.org>
Fri, 10 Jan 2020 22:21:25 +0000 (22:21 +0000)
committerAurelien Jarno <aurel32@debian.org>
Fri, 10 Jan 2020 22:21:25 +0000 (22:21 +0000)
    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 tg-hurdsig-fixes-2.diff

hurd/hurdsig.c
sysdeps/mach/hurd/fork.c
sysdeps/mach/hurd/spawni.c

index 62460787fa0b0ac3a1860c6071d5bc9a47fbeaca..9dc7ced0de42cf5015b96bd39ce67571ab09b026 100644 (file)
@@ -917,9 +917,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;
index 757a524b771e0622c1ca05a9e3cf10dba1333a65..f6aa821136af1cbb44937a4c7fd4e38d17ca4b7a 100644 (file)
@@ -655,8 +655,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 ();
index 2685ae281b425ab924c5163e8998b4572333b608..c72a9776562929ec262fdc43dde010bcf83dc613 100644 (file)
@@ -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.  */