diff options
author | Mark Kettenis <kettenis@gnu.org> | 2001-07-27 08:50:55 +0000 |
---|---|---|
committer | Mark Kettenis <kettenis@gnu.org> | 2001-07-27 08:50:55 +0000 |
commit | ac61ed310de12330be91ef3f7ffc8566bb6285b8 (patch) | |
tree | fcf92a6607b0f67253cbfe934f45610e44514952 /hurd/hurdsig.c | |
parent | 129d706d77587e4d6627cc1ebef9be0f7cbc65f0 (diff) | |
download | glibc-ac61ed310de12330be91ef3f7ffc8566bb6285b8.tar glibc-ac61ed310de12330be91ef3f7ffc8566bb6285b8.tar.gz glibc-ac61ed310de12330be91ef3f7ffc8566bb6285b8.tar.bz2 glibc-ac61ed310de12330be91ef3f7ffc8566bb6285b8.zip |
* hurd/hurdsig.c (_hurd_internal_post_signal): Fix handling of SA_RESETHAND and SA_NODEFER.
2001-07-26 Mark Kettenis <kettenis@gnu.org>
* hurd/hurdsig.c (_hurd_internal_post_signal): Fix handling of
SA_RESETHAND and SA_NODEFER.
Diffstat (limited to 'hurd/hurdsig.c')
-rw-r--r-- | hurd/hurdsig.c | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/hurd/hurdsig.c b/hurd/hurdsig.c index d95958a323..748d8406c1 100644 --- a/hurd/hurdsig.c +++ b/hurd/hurdsig.c @@ -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 |