* hurd/hurdsig.c (_hurd_internal_post_signal): Fix handling of SA_RESETHAND and SA_NO...
authorMark Kettenis <kettenis@gnu.org>
Fri, 27 Jul 2001 08:50:55 +0000 (08:50 +0000)
committerMark Kettenis <kettenis@gnu.org>
Fri, 27 Jul 2001 08:50:55 +0000 (08:50 +0000)
2001-07-26  Mark Kettenis  <kettenis@gnu.org>

* hurd/hurdsig.c (_hurd_internal_post_signal): Fix handling of
SA_RESETHAND and SA_NODEFER.

ChangeLog
hurd/hurdsig.c

index e7c8890..e98129e 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2001-07-26  Mark Kettenis  <kettenis@gnu.org>
+
+       * hurd/hurdsig.c (_hurd_internal_post_signal): Fix handling of
+       SA_RESETHAND and SA_NODEFER.
+
 2001-07-27  Ulrich Drepper  <drepper@redhat.com>
 
        * libio/fileops.c (_IO_new_file_fopen): Correctly locate ccs=
index d95958a..748d840 100644 (file)
@@ -926,14 +926,19 @@ _hurd_internal_post_signal (struct hurd_sigstate *ss,
        /* Backdoor extra argument to signal handler.  */
        scp->sc_error = detail->error;
 
+       /* Block requested signals while running the handler.  */
        scp->sc_mask = ss->blocked;
+       ss->blocked |= ss->actions[signo].sa_mask;
 
-       if ((ss->actions[signo].sa_flags & SA_NODEFER) == 0)
-         /* Block SIGNO and requested signals while running the handler.  */
-         ss->blocked |= __sigmask (signo) | ss->actions[signo].sa_mask;
+       /* Also block SIGNO unless we're asked not to.  */
+       if (! (ss->actions[signo].sa_flags & (SA_RESETHAND | SA_NODEFER)))
+         ss->blocked |= __sigmask (signo);
 
-       if (ss->actions[signo].sa_flags & SA_RESETHAND)
-         /* Silly SysV/Linux compatibility option.  */
+       /* Reset to SIG_DFL if requested.  SIGILL and SIGTRAP cannot
+           be automatically reset when delivered; the system silently
+           enforces this restriction.  */
+       if (ss->actions[signo].sa_flags & SA_RESETHAND
+           && signo != SIGILL && signo != SIGTRAP)
          ss->actions[signo].sa_handler = SIG_DFL;
 
        /* Start the thread running the handler (or possibly waiting for an