diff options
author | Martin Pieuchot <mpi@cvs.openbsd.org> | 2020-11-08 20:37:25 +0000 |
---|---|---|
committer | Martin Pieuchot <mpi@cvs.openbsd.org> | 2020-11-08 20:37:25 +0000 |
commit | 74031521d567c6ba0101870b3799b63a6be4201c (patch) | |
tree | 3ef9403e70b4fa0f787d65c95afe5ddcfdae39e6 /sys/arch/hppa | |
parent | b6b37e2cad6e38e3e6bf47dabf031f65e846050a (diff) |
In case of failure, call sigexit() from trapsignal instead of sensig().
Simplify MD code and reduce the amount of recursion into the signal code
which helps when dealing with locks.
ok cheloha@, deraadt@
Diffstat (limited to 'sys/arch/hppa')
-rw-r--r-- | sys/arch/hppa/hppa/machdep.c | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/sys/arch/hppa/hppa/machdep.c b/sys/arch/hppa/hppa/machdep.c index 896255798ba..5c127853003 100644 --- a/sys/arch/hppa/hppa/machdep.c +++ b/sys/arch/hppa/hppa/machdep.c @@ -1,4 +1,4 @@ -/* $OpenBSD: machdep.c,v 1.261 2020/10/21 04:10:56 deraadt Exp $ */ +/* $OpenBSD: machdep.c,v 1.262 2020/11/08 20:37:22 mpi Exp $ */ /* * Copyright (c) 1999-2003 Michael Shalayeff @@ -1207,7 +1207,7 @@ setregs(struct proc *p, struct exec_package *pack, u_long stack, /* * Send an interrupt to process. */ -void +int sendsig(sig_t catcher, int sig, sigset_t mask, const siginfo_t *ksip) { struct proc *p = curproc; @@ -1279,7 +1279,7 @@ sendsig(sig_t catcher, int sig, sigset_t mask, const siginfo_t *ksip) sizeof(ksc.sc_fpregs)); if (setstack(tf, scp + sss, tf->tf_r3)) - sigexit(p, SIGILL); + return 1; tf->tf_arg0 = sig; tf->tf_arg1 = sip; @@ -1293,12 +1293,14 @@ sendsig(sig_t catcher, int sig, sigset_t mask, const siginfo_t *ksip) ksc.sc_cookie = (long)scp ^ p->p_p->ps_sigcookie; if (copyout(&ksc, (void *)scp, sizeof(ksc))) - sigexit(p, SIGILL); + return 1; if (sip) { if (copyout(ksip, (void *)sip, sizeof *ksip)) - sigexit(p, SIGILL); + return 1; } + + return 0; } int |