summaryrefslogtreecommitdiff
path: root/sys/kern/kern_ktrace.c
diff options
context:
space:
mode:
authorPhilip Guenther <guenther@cvs.openbsd.org>2014-01-20 21:19:29 +0000
committerPhilip Guenther <guenther@cvs.openbsd.org>2014-01-20 21:19:29 +0000
commitee0ecd963da884228886664033fd7694a2eb8316 (patch)
tree52a9fc57aabaf3a0c1918697e14b24bc5f30528e /sys/kern/kern_ktrace.c
parentd97b363c4b36ac6fd5d7bd23bce2badd8549c7ee (diff)
Threads can't be zombies, only processes, so change zombproc to zombprocess,
make it a list of processes, and change P_NOZOMBIE and P_STOPPED from thread flags to process flags. Add allprocess list for the code that just wants to see processes. ok tedu@
Diffstat (limited to 'sys/kern/kern_ktrace.c')
-rw-r--r--sys/kern/kern_ktrace.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/sys/kern/kern_ktrace.c b/sys/kern/kern_ktrace.c
index 50e29d13398..da050c9e7fd 100644
--- a/sys/kern/kern_ktrace.c
+++ b/sys/kern/kern_ktrace.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: kern_ktrace.c,v 1.61 2013/09/14 02:28:01 guenther Exp $ */
+/* $OpenBSD: kern_ktrace.c,v 1.62 2014/01/20 21:19:28 guenther Exp $ */
/* $NetBSD: kern_ktrace.c,v 1.23 1996/02/09 18:59:36 christos Exp $ */
/*
@@ -403,7 +403,6 @@ sys_ktrace(struct proc *curp, void *v, register_t *retval)
syscallarg(pid_t) pid;
} */ *uap = v;
struct vnode *vp = NULL;
- struct proc *p = NULL;
struct process *pr = NULL;
struct ucred *cred = NULL;
struct pgrp *pg;
@@ -437,10 +436,10 @@ sys_ktrace(struct proc *curp, void *v, register_t *retval)
* Clear all uses of the tracefile
*/
if (ops == KTROP_CLEARFILE) {
- LIST_FOREACH(p, &allproc, p_list) {
- if (p->p_p->ps_tracevp == vp) {
- if (ktrcanset(curp, p->p_p))
- ktrcleartrace(p->p_p);
+ LIST_FOREACH(pr, &allprocess, ps_list) {
+ if (pr->ps_tracevp == vp) {
+ if (ktrcanset(curp, pr))
+ ktrcleartrace(pr);
else
error = EPERM;
}
@@ -587,6 +586,7 @@ ktrwriteraw(struct proc *p, struct vnode *vp, struct ucred *cred,
{
struct uio auio;
struct iovec aiov[2];
+ struct process *pr;
int error;
auio.uio_iov = &aiov[0];
@@ -615,9 +615,9 @@ ktrwriteraw(struct proc *p, struct vnode *vp, struct ucred *cred,
*/
log(LOG_NOTICE, "ktrace write failed, errno %d, tracing stopped\n",
error);
- LIST_FOREACH(p, &allproc, p_list)
- if (p->p_p->ps_tracevp == vp && p->p_p->ps_tracecred == cred)
- ktrcleartrace(p->p_p);
+ LIST_FOREACH(pr, &allprocess, ps_list)
+ if (pr->ps_tracevp == vp && pr->ps_tracecred == cred)
+ ktrcleartrace(pr);
vput(vp);
return (error);