Small signal fixes
authorJeremie Koenig <jk@jk.fr.eu.org>
Tue, 18 Oct 2016 21:10:46 +0000 (21:10 +0000)
committerAurelien Jarno <aurel32@debian.org>
Tue, 18 Oct 2016 21:10:46 +0000 (21:10 +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 576af1999ff81e00f30dcca84d0d933bf72d0799..62eb256023768967d75f1cd4e4e7a4a926670cfc 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 c3d6b604f70d5077073064469e7a5c1217403749..f8c47d926b70cd1984a13e25aee50bb70c51e314 100644 (file)
@@ -682,8 +682,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 ();
index 869de5e215fb9fa5eda7c326e0c0831e086a05a9..e4d0be152452f7c6cdca14796762e22480bf3fb1 100644 (file)
@@ -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.  */