Small signal fixes
authorJeremie Koenig <jk@jk.fr.eu.org>
Tue, 4 Sep 2018 19:13:02 +0000 (20:13 +0100)
committerSamuel Thibault <sthibault@debian.org>
Tue, 4 Sep 2018 19:13:02 +0000 (20:13 +0100)
    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 65c1b0a5abf9d49cae7fb2ff9608c9f57ca699fd..35d3bb87a7abd578fbf8804f729cbea62f0b5b6a 100644 (file)
@@ -904,9 +904,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 5d9b7a415adc3fbf7004916166bb35495658d6b9..786f84ecac6f24af670c326d6882f78a92976ed4 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 d7db75e1615c5f6fa47f5965ba042ddfb5a3b50a..e885ca8802cb864393207a8040133475c6073f94 100644 (file)
@@ -243,7 +243,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.  */