summaryrefslogtreecommitdiffstats
path: root/sys/kern
diff options
context:
space:
mode:
Diffstat (limited to 'sys/kern')
-rw-r--r--sys/kern/kern_exit.c7
-rw-r--r--sys/kern/kern_sig.c4
-rw-r--r--sys/kern/sys_process.c8
3 files changed, 9 insertions, 10 deletions
diff --git a/sys/kern/kern_exit.c b/sys/kern/kern_exit.c
index 8b5fe9d463a..62f927aefe4 100644
--- a/sys/kern/kern_exit.c
+++ b/sys/kern/kern_exit.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: kern_exit.c,v 1.111 2012/04/10 15:50:52 guenther Exp $ */
+/* $OpenBSD: kern_exit.c,v 1.112 2012/04/11 15:28:50 kettenis Exp $ */
/* $NetBSD: kern_exit.c,v 1.39 1996/04/22 01:38:25 christos Exp $ */
/*
@@ -488,10 +488,11 @@ loop:
return (0);
}
if (p->p_stat == SSTOP &&
- (p->p_flag & (P_WAITED|P_SUSPSINGLE)) == 0 &&
+ (pr->ps_flags & PS_WAITED) == 0 &&
+ (p->p_flag & P_SUSPSINGLE) == 0 &&
(pr->ps_flags & PS_TRACED ||
SCARG(uap, options) & WUNTRACED)) {
- atomic_setbits_int(&p->p_flag, P_WAITED);
+ atomic_setbits_int(&pr->ps_flags, PS_WAITED);
retval[0] = p->p_pid;
if (SCARG(uap, status)) {
diff --git a/sys/kern/kern_sig.c b/sys/kern/kern_sig.c
index 936d04c8e70..86dfae55cf7 100644
--- a/sys/kern/kern_sig.c
+++ b/sys/kern/kern_sig.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: kern_sig.c,v 1.138 2012/03/23 15:51:26 guenther Exp $ */
+/* $OpenBSD: kern_sig.c,v 1.139 2012/04/11 15:28:50 kettenis Exp $ */
/* $NetBSD: kern_sig.c,v 1.54 1996/04/22 01:38:32 christos Exp $ */
/*
@@ -1192,7 +1192,7 @@ proc_stop(struct proc *p, int sw)
#endif
p->p_stat = SSTOP;
- atomic_clearbits_int(&p->p_flag, P_WAITED);
+ atomic_clearbits_int(&p->p_p->ps_flags, PS_WAITED);
atomic_setbits_int(&p->p_flag, P_STOPPED|P_SUSPSIG);
if (!timeout_pending(&proc_stop_to)) {
timeout_add(&proc_stop_to, 0);
diff --git a/sys/kern/sys_process.c b/sys/kern/sys_process.c
index 1610ad88f17..8f665600f1d 100644
--- a/sys/kern/sys_process.c
+++ b/sys/kern/sys_process.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: sys_process.c,v 1.52 2012/04/06 20:28:51 kettenis Exp $ */
+/* $OpenBSD: sys_process.c,v 1.53 2012/04/11 15:28:50 kettenis Exp $ */
/* $NetBSD: sys_process.c,v 1.55 1996/05/15 06:17:47 tls Exp $ */
/*-
@@ -270,8 +270,7 @@ sys_ptrace(struct proc *p, void *v, register_t *retval)
/*
* (3) it's not currently stopped.
*/
- if (t->p_stat != SSTOP ||
- !ISSET(tr->ps_mainproc->p_flag, P_WAITED))
+ if (t->p_stat != SSTOP || !ISSET(tr->ps_flags, PS_WAITED))
return (EBUSY);
break;
@@ -485,8 +484,7 @@ sys_ptrace(struct proc *p, void *v, register_t *retval)
/* not being traced any more */
tr->ps_oppid = 0;
- atomic_clearbits_int(&tr->ps_flags, PS_TRACED);
- atomic_clearbits_int(&t->p_flag, P_WAITED);
+ atomic_clearbits_int(&tr->ps_flags, PS_TRACED|PS_WAITED);
sendsig:
bzero(tr->ps_ptstat, sizeof(*tr->ps_ptstat));