summaryrefslogtreecommitdiff
path: root/sys/kern
diff options
context:
space:
mode:
Diffstat (limited to 'sys/kern')
-rw-r--r--sys/kern/exec_elf.c10
-rw-r--r--sys/kern/init_main.c7
-rw-r--r--sys/kern/kern_exit.c8
-rw-r--r--sys/kern/kern_sig.c167
-rw-r--r--sys/kern/kern_sysctl.c5
-rw-r--r--sys/kern/tty.c8
-rw-r--r--sys/kern/tty_pty.c4
7 files changed, 104 insertions, 105 deletions
diff --git a/sys/kern/exec_elf.c b/sys/kern/exec_elf.c
index fe425ad2b36..92f3af0e761 100644
--- a/sys/kern/exec_elf.c
+++ b/sys/kern/exec_elf.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: exec_elf.c,v 1.79 2011/04/05 12:50:15 guenther Exp $ */
+/* $OpenBSD: exec_elf.c,v 1.80 2011/04/15 04:52:40 guenther Exp $ */
/*
* Copyright (c) 1996 Per Fogelstrom
@@ -1147,13 +1147,13 @@ ELFNAMEEND(coredump_notes)(struct proc *p, void *iocookie, size_t *sizep)
cpi.cpi_version = ELFCORE_PROCINFO_VERSION;
cpi.cpi_cpisize = sizeof(cpi);
- cpi.cpi_signo = p->p_sigacts->ps_sig;
- cpi.cpi_sigcode = p->p_sigacts->ps_code;
+ cpi.cpi_signo = p->p_sisig;
+ cpi.cpi_sigcode = p->p_sicode;
cpi.cpi_sigpend = p->p_siglist;
cpi.cpi_sigmask = p->p_sigmask;
- cpi.cpi_sigignore = p->p_sigignore;
- cpi.cpi_sigcatch = p->p_sigcatch;
+ cpi.cpi_sigignore = p->p_sigacts->ps_sigignore;
+ cpi.cpi_sigcatch = p->p_sigacts->ps_sigcatch;
cpi.cpi_pid = pr->ps_pid;
cpi.cpi_ppid = pr->ps_pptr->ps_pid;
diff --git a/sys/kern/init_main.c b/sys/kern/init_main.c
index 84dc1943c12..5c5025ef1c3 100644
--- a/sys/kern/init_main.c
+++ b/sys/kern/init_main.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: init_main.c,v 1.175 2011/03/07 07:07:13 guenther Exp $ */
+/* $OpenBSD: init_main.c,v 1.176 2011/04/15 04:52:40 guenther Exp $ */
/* $NetBSD: init_main.c,v 1.84.4.1 1996/06/02 09:08:06 mrg Exp $ */
/*
@@ -283,7 +283,7 @@ main(void *framep)
session0.s_count = 1;
session0.s_leader = pr;
- atomic_setbits_int(&p->p_flag, P_SYSTEM | P_NOCLDWAIT);
+ atomic_setbits_int(&p->p_flag, P_SYSTEM);
p->p_stat = SONPROC;
pr->ps_nice = NZERO;
p->p_emul = &emul_native;
@@ -615,6 +615,9 @@ start_init(void *arg)
check_console(p);
+ /* process 0 ignores SIGCHLD, but we can't */
+ p->p_sigacts->ps_flags = 0;
+
/*
* Need just enough stack to hold the faked-up "execve()" arguments.
*/
diff --git a/sys/kern/kern_exit.c b/sys/kern/kern_exit.c
index 40c73d9a7ab..854743e5183 100644
--- a/sys/kern/kern_exit.c
+++ b/sys/kern/kern_exit.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: kern_exit.c,v 1.98 2011/04/03 14:56:28 guenther Exp $ */
+/* $OpenBSD: kern_exit.c,v 1.99 2011/04/15 04:52:40 guenther Exp $ */
/* $NetBSD: kern_exit.c,v 1.39 1996/04/22 01:38:25 christos Exp $ */
/*
@@ -176,7 +176,6 @@ exit1(struct proc *p, int rv, int flags)
if (p->p_flag & P_PROFIL)
stopprofclock(p);
p->p_ru = pool_get(&rusage_pool, PR_WAITOK);
- p->p_sigignore = ~0;
p->p_siglist = 0;
timeout_del(&p->p_realit_to);
timeout_del(&p->p_stats->p_virt_to);
@@ -305,11 +304,12 @@ exit1(struct proc *p, int rv, int flags)
/*
* Notify parent that we're gone. If we have P_NOZOMBIE
- * or parent has the P_NOCLDWAIT flag set, notify process 1
+ * or parent has the SAS_NOCLDWAIT flag set, notify process 1
* instead (and hope it will handle this situation).
*/
if ((p->p_flag & P_NOZOMBIE) ||
- (pr->ps_pptr->ps_mainproc->p_flag & P_NOCLDWAIT)) {
+ (pr->ps_pptr->ps_mainproc->p_sigacts->ps_flags &
+ SAS_NOCLDWAIT)) {
struct process *ppr = pr->ps_pptr;
proc_reparent(pr, initproc->p_p);
/*
diff --git a/sys/kern/kern_sig.c b/sys/kern/kern_sig.c
index 6e1c1ead1e9..53e72da6b78 100644
--- a/sys/kern/kern_sig.c
+++ b/sys/kern/kern_sig.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: kern_sig.c,v 1.119 2011/04/03 14:56:28 guenther Exp $ */
+/* $OpenBSD: kern_sig.c,v 1.120 2011/04/15 04:52:40 guenther Exp $ */
/* $NetBSD: kern_sig.c,v 1.54 1996/04/22 01:38:32 christos Exp $ */
/*
@@ -242,9 +242,9 @@ sys_sigaction(struct proc *p, void *v, register_t *retval)
if ((ps->ps_siginfo & bit) != 0)
sa->sa_flags |= SA_SIGINFO;
if (signum == SIGCHLD) {
- if ((p->p_flag & P_NOCLDSTOP) != 0)
+ if ((ps->ps_flags & SAS_NOCLDSTOP) != 0)
sa->sa_flags |= SA_NOCLDSTOP;
- if ((p->p_flag & P_NOCLDWAIT) != 0)
+ if ((ps->ps_flags & SAS_NOCLDWAIT) != 0)
sa->sa_flags |= SA_NOCLDWAIT;
}
if ((sa->sa_mask & bit) == 0)
@@ -281,21 +281,22 @@ setsigvec(struct proc *p, int signum, struct sigaction *sa)
ps->ps_catchmask[signum] = sa->sa_mask &~ sigcantmask;
if (signum == SIGCHLD) {
if (sa->sa_flags & SA_NOCLDSTOP)
- atomic_setbits_int(&p->p_flag, P_NOCLDSTOP);
+ atomic_setbits_int(&ps->ps_flags, SAS_NOCLDSTOP);
else
- atomic_clearbits_int(&p->p_flag, P_NOCLDSTOP);
+ atomic_clearbits_int(&ps->ps_flags, SAS_NOCLDSTOP);
/*
* If the SA_NOCLDWAIT flag is set or the handler
* is SIG_IGN we reparent the dying child to PID 1
* (init) which will reap the zombie. Because we use
- * init to do our dirty work we never set P_NOCLDWAIT
+ * init to do our dirty work we never set SAS_NOCLDWAIT
* for PID 1.
*/
- if (p->p_pid != 1 && ((sa->sa_flags & SA_NOCLDWAIT) ||
+ if (initproc->p_sigacts != ps &&
+ ((sa->sa_flags & SA_NOCLDWAIT) ||
sa->sa_handler == SIG_IGN))
- atomic_setbits_int(&p->p_flag, P_NOCLDWAIT);
+ atomic_setbits_int(&ps->ps_flags, SAS_NOCLDWAIT);
else
- atomic_clearbits_int(&p->p_flag, P_NOCLDWAIT);
+ atomic_clearbits_int(&ps->ps_flags, SAS_NOCLDWAIT);
}
if ((sa->sa_flags & SA_RESETHAND) != 0)
ps->ps_sigreset |= bit;
@@ -314,23 +315,23 @@ setsigvec(struct proc *p, int signum, struct sigaction *sa)
else
ps->ps_sigonstack &= ~bit;
/*
- * Set bit in p_sigignore for signals that are set to SIG_IGN,
+ * Set bit in ps_sigignore for signals that are set to SIG_IGN,
* and for signals set to SIG_DFL where the default is to ignore.
- * However, don't put SIGCONT in p_sigignore,
+ * However, don't put SIGCONT in ps_sigignore,
* as we have to restart the process.
*/
if (sa->sa_handler == SIG_IGN ||
(sigprop[signum] & SA_IGNORE && sa->sa_handler == SIG_DFL)) {
atomic_clearbits_int(&p->p_siglist, bit);
if (signum != SIGCONT)
- p->p_sigignore |= bit; /* easier in psignal */
- p->p_sigcatch &= ~bit;
+ ps->ps_sigignore |= bit; /* easier in psignal */
+ ps->ps_sigcatch &= ~bit;
} else {
- p->p_sigignore &= ~bit;
+ ps->ps_sigignore &= ~bit;
if (sa->sa_handler == SIG_DFL)
- p->p_sigcatch &= ~bit;
+ ps->ps_sigcatch &= ~bit;
else
- p->p_sigcatch |= bit;
+ ps->ps_sigcatch |= bit;
}
splx(s);
}
@@ -342,11 +343,13 @@ setsigvec(struct proc *p, int signum, struct sigaction *sa)
void
siginit(struct proc *p)
{
+ struct sigacts *ps = p->p_sigacts;
int i;
for (i = 0; i < NSIG; i++)
if (sigprop[i] & SA_IGNORE && i != SIGCONT)
- p->p_sigignore |= sigmask(i);
+ ps->ps_sigignore |= sigmask(i);
+ ps->ps_flags = SAS_NOCLDWAIT | SAS_NOCLDSTOP;
}
/*
@@ -366,13 +369,13 @@ execsigs(struct proc *p)
* through p_sigmask (unless they were caught,
* and are now ignored by default).
*/
- while (p->p_sigcatch) {
- nc = ffs((long)p->p_sigcatch);
+ while (ps->ps_sigcatch) {
+ nc = ffs((long)ps->ps_sigcatch);
mask = sigmask(nc);
- p->p_sigcatch &= ~mask;
+ ps->ps_sigcatch &= ~mask;
if (sigprop[nc] & SA_IGNORE) {
if (nc != SIGCONT)
- p->p_sigignore |= mask;
+ ps->ps_sigignore |= mask;
atomic_clearbits_int(&p->p_siglist, mask);
}
ps->ps_sigact[nc] = SIG_DFL;
@@ -381,11 +384,10 @@ execsigs(struct proc *p)
* Reset stack state to the user stack.
* Clear set of signals caught on the signal stack.
*/
- ps->ps_sigstk.ss_flags = SS_DISABLE;
- ps->ps_sigstk.ss_size = 0;
- ps->ps_sigstk.ss_sp = 0;
- ps->ps_flags = 0;
- atomic_clearbits_int(&p->p_flag, P_NOCLDWAIT);
+ p->p_sigstk.ss_flags = SS_DISABLE;
+ p->p_sigstk.ss_size = 0;
+ p->p_sigstk.ss_sp = 0;
+ ps->ps_flags &= ~SAS_NOCLDWAIT;
if (ps->ps_sigact[SIGCHLD] == SIG_IGN)
ps->ps_sigact[SIGCHLD] = SIG_DFL;
}
@@ -459,8 +461,8 @@ sys_sigsuspend(struct proc *p, void *v, register_t *retval)
* save it here and mark the sigacts structure
* to indicate this.
*/
- ps->ps_oldmask = p->p_sigmask;
- ps->ps_flags |= SAS_OLDMASK;
+ p->p_oldmask = p->p_sigmask;
+ atomic_setbits_int(&p->p_flag, P_SIGSUSPEND);
p->p_sigmask = SCARG(uap, mask) &~ sigcantmask;
while (tsleep(ps, PPAUSE|PCATCH, "pause", 0) == 0)
/* void */;
@@ -476,7 +478,6 @@ sys_osigaltstack(struct proc *p, void *v, register_t *retval)
syscallarg(const struct osigaltstack *) nss;
syscallarg(struct osigaltstack *) oss;
} */ *uap = v;
- struct sigacts *psp;
struct osigaltstack ss;
const struct osigaltstack *nss;
struct osigaltstack *oss;
@@ -485,13 +486,10 @@ sys_osigaltstack(struct proc *p, void *v, register_t *retval)
nss = SCARG(uap, nss);
oss = SCARG(uap, oss);
- psp = p->p_sigacts;
- if ((psp->ps_flags & SAS_ALTSTACK) == 0)
- psp->ps_sigstk.ss_flags |= SS_DISABLE;
if (oss) {
- ss.ss_sp = psp->ps_sigstk.ss_sp;
- ss.ss_size = psp->ps_sigstk.ss_size;
- ss.ss_flags = psp->ps_sigstk.ss_flags;
+ ss.ss_sp = p->p_sigstk.ss_sp;
+ ss.ss_size = p->p_sigstk.ss_size;
+ ss.ss_flags = p->p_sigstk.ss_flags;
if ((error = copyout(&ss, oss, sizeof(ss))))
return (error);
}
@@ -500,19 +498,19 @@ sys_osigaltstack(struct proc *p, void *v, register_t *retval)
error = copyin(nss, &ss, sizeof(ss));
if (error)
return (error);
+ if (p->p_sigstk.ss_flags & SS_ONSTACK)
+ return (EPERM);
+ if (ss.ss_flags & ~SS_DISABLE)
+ return (EINVAL);
if (ss.ss_flags & SS_DISABLE) {
- if (psp->ps_sigstk.ss_flags & SS_ONSTACK)
- return (EINVAL);
- psp->ps_flags &= ~SAS_ALTSTACK;
- psp->ps_sigstk.ss_flags = ss.ss_flags;
+ p->p_sigstk.ss_flags = ss.ss_flags;
return (0);
}
if (ss.ss_size < MINSIGSTKSZ)
return (ENOMEM);
- psp->ps_flags |= SAS_ALTSTACK;
- psp->ps_sigstk.ss_sp = ss.ss_sp;
- psp->ps_sigstk.ss_size = ss.ss_size;
- psp->ps_sigstk.ss_flags = ss.ss_flags;
+ p->p_sigstk.ss_sp = ss.ss_sp;
+ p->p_sigstk.ss_size = ss.ss_size;
+ p->p_sigstk.ss_flags = ss.ss_flags;
return (0);
}
@@ -523,7 +521,6 @@ sys_sigaltstack(struct proc *p, void *v, register_t *retval)
syscallarg(const struct sigaltstack *) nss;
syscallarg(struct sigaltstack *) oss;
} */ *uap = v;
- struct sigacts *psp;
struct sigaltstack ss;
const struct sigaltstack *nss;
struct sigaltstack *oss;
@@ -532,28 +529,24 @@ sys_sigaltstack(struct proc *p, void *v, register_t *retval)
nss = SCARG(uap, nss);
oss = SCARG(uap, oss);
- psp = p->p_sigacts;
- if ((psp->ps_flags & SAS_ALTSTACK) == 0)
- psp->ps_sigstk.ss_flags |= SS_DISABLE;
- if (oss && (error = copyout(&psp->ps_sigstk,
- oss, sizeof(struct sigaltstack))))
+ if (oss && (error = copyout(&p->p_sigstk, oss, sizeof(p->p_sigstk))))
return (error);
if (nss == NULL)
return (0);
error = copyin(nss, &ss, sizeof(ss));
if (error)
return (error);
+ if (p->p_sigstk.ss_flags & SS_ONSTACK)
+ return (EPERM);
+ if (ss.ss_flags & ~SS_DISABLE)
+ return (EINVAL);
if (ss.ss_flags & SS_DISABLE) {
- if (psp->ps_sigstk.ss_flags & SS_ONSTACK)
- return (EINVAL);
- psp->ps_flags &= ~SAS_ALTSTACK;
- psp->ps_sigstk.ss_flags = ss.ss_flags;
+ p->p_sigstk.ss_flags = ss.ss_flags;
return (0);
}
if (ss.ss_size < MINSIGSTKSZ)
return (ENOMEM);
- psp->ps_flags |= SAS_ALTSTACK;
- psp->ps_sigstk = ss;
+ p->p_sigstk = ss;
return (0);
}
@@ -737,7 +730,7 @@ trapsignal(struct proc *p, int signum, u_long code, int type,
int mask;
mask = sigmask(signum);
- if ((p->p_flag & P_TRACED) == 0 && (p->p_sigcatch & mask) != 0 &&
+ if ((p->p_flag & P_TRACED) == 0 && (ps->ps_sigcatch & mask) != 0 &&
(p->p_sigmask & mask) == 0) {
#ifdef KTRACE
if (KTRPOINT(p, KTR_PSIG)) {
@@ -753,16 +746,16 @@ trapsignal(struct proc *p, int signum, u_long code, int type,
p->p_sigmask, code, type, sigval);
p->p_sigmask |= ps->ps_catchmask[signum];
if ((ps->ps_sigreset & mask) != 0) {
- p->p_sigcatch &= ~mask;
+ ps->ps_sigcatch &= ~mask;
if (signum != SIGCONT && sigprop[signum] & SA_IGNORE)
- p->p_sigignore |= mask;
+ ps->ps_sigignore |= mask;
ps->ps_sigact[signum] = SIG_DFL;
}
} else {
- ps->ps_sig = signum;
- ps->ps_code = code; /* XXX for core dump/debugger */
- ps->ps_type = type;
- ps->ps_sigval = sigval;
+ p->p_sisig = signum;
+ p->p_sicode = code; /* XXX for core dump/debugger */
+ p->p_sitype = type;
+ p->p_sigval = sigval;
ptsignal(p, signum, STHREAD);
}
}
@@ -845,15 +838,15 @@ ptsignal(struct proc *p, int signum, enum signal_type type)
/*
* If the signal is being ignored,
* then we forget about it immediately.
- * (Note: we don't set SIGCONT in p_sigignore,
+ * (Note: we don't set SIGCONT in ps_sigignore,
* and if it is set to SIG_IGN,
* action will be SIG_DFL here.)
*/
- if (p->p_sigignore & mask)
+ if (p->p_sigacts->ps_sigignore & mask)
return;
if (p->p_sigmask & mask)
action = SIG_HOLD;
- else if (p->p_sigcatch & mask)
+ else if (p->p_sigacts->ps_sigcatch & mask)
action = SIG_CATCH;
else {
action = SIG_DFL;
@@ -1068,7 +1061,8 @@ issignal(struct proc *p)
* We should see pending but ignored signals
* only if P_TRACED was on when they were posted.
*/
- if (mask & p->p_sigignore && (p->p_flag & P_TRACED) == 0)
+ if (mask & p->p_sigacts->ps_sigignore &&
+ (p->p_flag & P_TRACED) == 0)
continue;
if (p->p_flag & P_TRACED &&
@@ -1228,7 +1222,8 @@ proc_stop_sweep(void *v)
continue;
atomic_clearbits_int(&p->p_flag, P_STOPPED);
- if ((p->p_p->ps_pptr->ps_mainproc->p_flag & P_NOCLDSTOP) == 0)
+ if ((p->p_p->ps_pptr->ps_mainproc->p_sigacts->ps_flags &
+ SAS_NOCLDSTOP) == 0)
prsignal(p->p_p->ps_pptr, SIGCHLD);
wakeup(p->p_p->ps_pptr);
}
@@ -1262,14 +1257,14 @@ postsig(int signum)
sigval.sival_ptr = 0;
type = SI_USER;
- if (ps->ps_sig != signum) {
+ if (p->p_sisig != signum) {
code = 0;
type = SI_USER;
sigval.sival_ptr = 0;
} else {
- code = ps->ps_code;
- type = ps->ps_type;
- sigval = ps->ps_sigval;
+ code = p->p_sicode;
+ type = p->p_sitype;
+ sigval = p->p_sigval;
}
#ifdef KTRACE
@@ -1277,8 +1272,8 @@ postsig(int signum)
siginfo_t si;
initsiginfo(&si, signum, code, type, sigval);
- ktrpsig(p, signum, action, ps->ps_flags & SAS_OLDMASK ?
- ps->ps_oldmask : p->p_sigmask, type, &si);
+ ktrpsig(p, signum, action, p->p_flag & P_SIGSUSPEND ?
+ p->p_oldmask : p->p_sigmask, type, &si);
}
#endif
if (action == SIG_DFL) {
@@ -1310,25 +1305,25 @@ postsig(int signum)
#else
s = splhigh();
#endif
- if (ps->ps_flags & SAS_OLDMASK) {
- returnmask = ps->ps_oldmask;
- ps->ps_flags &= ~SAS_OLDMASK;
+ if (p->p_flag & P_SIGSUSPEND) {
+ atomic_clearbits_int(&p->p_flag, P_SIGSUSPEND);
+ returnmask = p->p_oldmask;
} else
returnmask = p->p_sigmask;
p->p_sigmask |= ps->ps_catchmask[signum];
if ((ps->ps_sigreset & mask) != 0) {
- p->p_sigcatch &= ~mask;
+ ps->ps_sigcatch &= ~mask;
if (signum != SIGCONT && sigprop[signum] & SA_IGNORE)
- p->p_sigignore |= mask;
+ ps->ps_sigignore |= mask;
ps->ps_sigact[signum] = SIG_DFL;
}
splx(s);
p->p_stats->p_ru.ru_nsignals++;
- if (ps->ps_sig == signum) {
- ps->ps_sig = 0;
- ps->ps_code = 0;
- ps->ps_type = SI_USER;
- ps->ps_sigval.sival_ptr = NULL;
+ if (p->p_sisig == signum) {
+ p->p_sisig = 0;
+ p->p_sicode = 0;
+ p->p_sitype = SI_USER;
+ p->p_sigval.sival_ptr = NULL;
}
(*p->p_emul->e_sendsig)(action, signum, returnmask, code,
@@ -1354,7 +1349,7 @@ sigexit(struct proc *p, int signum)
p->p_acflag |= AXSIG;
if (sigprop[signum] & SA_CORE) {
- p->p_sigacts->ps_sig = signum;
+ p->p_sisig = signum;
if (coredump(p) == 0)
signum |= WCOREFLAG;
}
@@ -1479,8 +1474,8 @@ coredump_trad(struct proc *p, void *cookie)
core.c_midmag = 0;
strlcpy(core.c_name, p->p_comm, sizeof(core.c_name));
core.c_nseg = 0;
- core.c_signo = p->p_sigacts->ps_sig;
- core.c_ucode = p->p_sigacts->ps_code;
+ core.c_signo = p->p_sisig;
+ core.c_ucode = p->p_sicode;
core.c_cpusize = 0;
core.c_tsize = (u_long)ptoa(vm->vm_tsize);
core.c_dsize = (u_long)ptoa(vm->vm_dsize);
diff --git a/sys/kern/kern_sysctl.c b/sys/kern/kern_sysctl.c
index 2ac85792d08..d48c77e4a34 100644
--- a/sys/kern/kern_sysctl.c
+++ b/sys/kern/kern_sysctl.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: kern_sysctl.c,v 1.200 2011/04/04 11:13:55 deraadt Exp $ */
+/* $OpenBSD: kern_sysctl.c,v 1.201 2011/04/15 04:52:40 guenther Exp $ */
/* $NetBSD: kern_sysctl.c,v 1.17 1996/05/20 17:49:05 mrg Exp $ */
/*-
@@ -45,6 +45,7 @@
#include <sys/malloc.h>
#include <sys/proc.h>
#include <sys/resourcevar.h>
+#include <sys/signalvar.h>
#include <sys/file.h>
#include <sys/filedesc.h>
#include <sys/vnode.h>
@@ -1473,7 +1474,7 @@ fill_kproc(struct proc *p, struct kinfo_proc *ki)
struct timeval ut, st;
FILL_KPROC(ki, strlcpy, p, pr, p->p_cred, p->p_ucred, pr->ps_pgrp,
- p, pr, s, p->p_vmspace, pr->ps_limit, p->p_stats);
+ p, pr, s, p->p_vmspace, pr->ps_limit, p->p_stats, p->p_sigacts);
/* stuff that's too painful to generalize into the macros */
if (pr->ps_pptr)
diff --git a/sys/kern/tty.c b/sys/kern/tty.c
index 5b3769ae34a..fbb6921eecc 100644
--- a/sys/kern/tty.c
+++ b/sys/kern/tty.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: tty.c,v 1.89 2011/04/03 14:56:28 guenther Exp $ */
+/* $OpenBSD: tty.c,v 1.90 2011/04/15 04:52:40 guenther Exp $ */
/* $NetBSD: tty.c,v 1.68.4.2 1996/06/06 16:04:52 thorpej Exp $ */
/*-
@@ -750,7 +750,7 @@ ttioctl(struct tty *tp, u_long cmd, caddr_t data, int flag, struct proc *p)
#endif
while (isbackground(pr, tp) &&
(pr->ps_flags & PS_PPWAIT) == 0 &&
- (p->p_sigignore & sigmask(SIGTTOU)) == 0 &&
+ (p->p_sigacts->ps_sigignore & sigmask(SIGTTOU)) == 0 &&
(p->p_sigmask & sigmask(SIGTTOU)) == 0) {
if (pr->ps_pgrp->pg_jobc == 0)
return (EIO);
@@ -1462,7 +1462,7 @@ loop: lflag = tp->t_lflag;
* Hang process if it's in the background.
*/
if (isbackground(pr, tp)) {
- if ((p->p_sigignore & sigmask(SIGTTIN)) ||
+ if ((p->p_sigacts->ps_sigignore & sigmask(SIGTTIN)) ||
(p->p_sigmask & sigmask(SIGTTIN)) ||
pr->ps_flags & PS_PPWAIT || pr->ps_pgrp->pg_jobc == 0) {
error = EIO;
@@ -1719,7 +1719,7 @@ loop:
pr = p->p_p;
if (isbackground(pr, tp) &&
ISSET(tp->t_lflag, TOSTOP) && (pr->ps_flags & PS_PPWAIT) == 0 &&
- (p->p_sigignore & sigmask(SIGTTOU)) == 0 &&
+ (p->p_sigacts->ps_sigignore & sigmask(SIGTTOU)) == 0 &&
(p->p_sigmask & sigmask(SIGTTOU)) == 0) {
if (pr->ps_pgrp->pg_jobc == 0) {
error = EIO;
diff --git a/sys/kern/tty_pty.c b/sys/kern/tty_pty.c
index dde88c46a50..2eef0737115 100644
--- a/sys/kern/tty_pty.c
+++ b/sys/kern/tty_pty.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: tty_pty.c,v 1.53 2011/04/03 14:56:28 guenther Exp $ */
+/* $OpenBSD: tty_pty.c,v 1.54 2011/04/15 04:52:40 guenther Exp $ */
/* $NetBSD: tty_pty.c,v 1.33.4.1 1996/06/02 09:08:11 mrg Exp $ */
/*
@@ -291,7 +291,7 @@ ptsread(dev_t dev, struct uio *uio, int flag)
again:
if (pti->pt_flags & PF_REMOTE) {
while (isbackground(pr, tp)) {
- if ((p->p_sigignore & sigmask(SIGTTIN)) ||
+ if ((p->p_sigacts->ps_sigignore & sigmask(SIGTTIN)) ||
(p->p_sigmask & sigmask(SIGTTIN)) ||
pr->ps_pgrp->pg_jobc == 0 ||
pr->ps_flags & PS_PPWAIT)