[PATCH] Small signal fixes
authorJeremie Koenig <jk@jk.fr.eu.org>
Tue, 15 Mar 2022 22:48:49 +0000 (22:48 +0000)
committerAurelien Jarno <aurel32@debian.org>
Tue, 15 Mar 2022 22:48:49 +0000 (22:48 +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 e15ad88ceaa0e3cba2b9ab8fa7b5eacb0aed2c2b..5402391600e0c58b7a9900fd94cb6d3f7f766300 100644 (file)
@@ -914,9 +914,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 3d8e45df13b575547648a7af220ae5f8a36196f4..fb60c8cc9d2bc580040401272a721bbb7d48ec7f 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.  */