diff options
author | Philip Guenther <guenther@cvs.openbsd.org> | 2018-07-10 04:20:00 +0000 |
---|---|---|
committer | Philip Guenther <guenther@cvs.openbsd.org> | 2018-07-10 04:20:00 +0000 |
commit | 84563ae4ac61f5d4628a59cc1f360bac3b358a91 (patch) | |
tree | 9f1c9eefd3cc11188b6cb6067649b87f07cac5bd /sys/kern | |
parent | 121f0ab6733b183e0cd858c2e7b05e1d87d20cfb (diff) |
Move from sendsig() to its callers the initsiginfo() calls and
instead of passing sendsig() the code+type+val, pass a siginfo_t*
to copy from. Eliminate the indirection through struct emul for
sendsig(); we no longer have a SunOS4-compat version of sendsig()
ok deraadt@
Diffstat (limited to 'sys/kern')
-rw-r--r-- | sys/kern/exec_elf.c | 3 | ||||
-rw-r--r-- | sys/kern/init_main.c | 3 | ||||
-rw-r--r-- | sys/kern/kern_sig.c | 18 |
3 files changed, 9 insertions, 15 deletions
diff --git a/sys/kern/exec_elf.c b/sys/kern/exec_elf.c index 0a2fc0a9c8a..6fb2183db65 100644 --- a/sys/kern/exec_elf.c +++ b/sys/kern/exec_elf.c @@ -1,4 +1,4 @@ -/* $OpenBSD: exec_elf.c,v 1.142 2017/12/30 23:08:29 guenther Exp $ */ +/* $OpenBSD: exec_elf.c,v 1.143 2018/07/10 04:19:59 guenther Exp $ */ /* * Copyright (c) 1996 Per Fogelstrom @@ -132,7 +132,6 @@ extern char *syscallnames[]; struct emul emul_elf = { "native", NULL, - sendsig, SYS_syscall, SYS_MAXSYSCALL, sysent, diff --git a/sys/kern/init_main.c b/sys/kern/init_main.c index f5a4984070a..f4381ae8bd6 100644 --- a/sys/kern/init_main.c +++ b/sys/kern/init_main.c @@ -1,4 +1,4 @@ -/* $OpenBSD: init_main.c,v 1.277 2018/04/28 03:13:04 visa Exp $ */ +/* $OpenBSD: init_main.c,v 1.278 2018/07/10 04:19:59 guenther Exp $ */ /* $NetBSD: init_main.c,v 1.84.4.1 1996/06/02 09:08:06 mrg Exp $ */ /* @@ -159,7 +159,6 @@ extern char *syscallnames[]; struct emul emul_native = { "native", NULL, - sendsig, SYS_syscall, SYS_MAXSYSCALL, sysent, diff --git a/sys/kern/kern_sig.c b/sys/kern/kern_sig.c index db7adf619ba..823ab102b7b 100644 --- a/sys/kern/kern_sig.c +++ b/sys/kern/kern_sig.c @@ -1,4 +1,4 @@ -/* $OpenBSD: kern_sig.c,v 1.220 2018/04/28 03:13:04 visa Exp $ */ +/* $OpenBSD: kern_sig.c,v 1.221 2018/07/10 04:19:59 guenther Exp $ */ /* $NetBSD: kern_sig.c,v 1.54 1996/04/22 01:38:32 christos Exp $ */ /* @@ -798,17 +798,15 @@ trapsignal(struct proc *p, int signum, u_long trapno, int code, if ((pr->ps_flags & PS_TRACED) == 0 && (ps->ps_sigcatch & mask) != 0 && (p->p_sigmask & mask) == 0) { + siginfo_t si; + initsiginfo(&si, signum, trapno, code, sigval); #ifdef KTRACE if (KTRPOINT(p, KTR_PSIG)) { - siginfo_t si; - - initsiginfo(&si, signum, trapno, code, sigval); ktrpsig(p, signum, ps->ps_sigact[signum], p->p_sigmask, code, &si); } #endif - (*pr->ps_emul->e_sendsig)(ps->ps_sigact[signum], signum, - p->p_sigmask, trapno, code, sigval); + sendsig(ps->ps_sigact[signum], signum, p->p_sigmask, &si); postsig_done(p, signum, ps); } else { p->p_sisig = signum; @@ -1359,6 +1357,7 @@ postsig(struct proc *p, int signum) sig_t action; u_long trapno; int mask, returnmask; + siginfo_t si; union sigval sigval; int s, code; @@ -1379,12 +1378,10 @@ postsig(struct proc *p, int signum) code = p->p_sicode; sigval = p->p_sigval; } + initsiginfo(&si, signum, trapno, code, sigval); #ifdef KTRACE if (KTRPOINT(p, KTR_PSIG)) { - siginfo_t si; - - initsiginfo(&si, signum, trapno, code, sigval); ktrpsig(p, signum, action, p->p_flag & P_SIGSUSPEND ? p->p_oldmask : p->p_sigmask, code, &si); } @@ -1431,8 +1428,7 @@ postsig(struct proc *p, int signum) p->p_sigval.sival_ptr = NULL; } - (*pr->ps_emul->e_sendsig)(action, signum, returnmask, trapno, - code, sigval); + sendsig(action, signum, returnmask, &si); postsig_done(p, signum, ps); splx(s); } |