diff options
author | Philip Guenthe <guenther@cvs.openbsd.org> | 2012-06-02 05:44:28 +0000 |
---|---|---|
committer | Philip Guenthe <guenther@cvs.openbsd.org> | 2012-06-02 05:44:28 +0000 |
commit | 1e2018359cc105bc903d017b1eea4a55603eec86 (patch) | |
tree | 523064d961336d608215987137eeb46bdf0c6c65 | |
parent | 19e779357f7cd0f326d00b06db357a45e80d8698 (diff) |
Committed the wrong version (an earlier try) of the KERN_FILE2 vs
rthreads fix. Update to the correct one.
-rw-r--r-- | lib/libkvm/kvm_file2.c | 6 | ||||
-rw-r--r-- | sys/kern/kern_sysctl.c | 6 |
2 files changed, 7 insertions, 5 deletions
diff --git a/lib/libkvm/kvm_file2.c b/lib/libkvm/kvm_file2.c index 92db2ffef6c..570e5a4573c 100644 --- a/lib/libkvm/kvm_file2.c +++ b/lib/libkvm/kvm_file2.c @@ -1,4 +1,4 @@ -/* $OpenBSD: kvm_file2.c,v 1.24 2012/05/01 03:43:23 guenther Exp $ */ +/* $OpenBSD: kvm_file2.c,v 1.25 2012/06/02 05:44:27 guenther Exp $ */ /* * Copyright (c) 2009 Todd C. Miller <Todd.Miller@courtesan.com> @@ -316,7 +316,7 @@ kvm_deadfile2_byid(kvm_t *kd, int op, int arg, size_t esize, int *cnt) } /* skip system, embryonic and undead processes */ - if ((proc.p_flag & P_SYSTEM) || + if ((proc.p_flag & P_SYSTEM) || (proc.p_flag & P_THREAD) || proc.p_stat == SIDL || proc.p_stat == SZOMB) continue; if (op == KERN_FILE_BYPID) { @@ -339,6 +339,8 @@ kvm_deadfile2_byid(kvm_t *kd, int op, int arg, size_t esize, int *cnt) proc.p_p); goto cleanup; } + if (process.ps_flags & PS_EXITING) + continue; proc.p_p = &process; if ((proc.p_flag & P_THREAD) == 0) pid = proc.p_pid; diff --git a/sys/kern/kern_sysctl.c b/sys/kern/kern_sysctl.c index 2f32fd7d352..5e516070140 100644 --- a/sys/kern/kern_sysctl.c +++ b/sys/kern/kern_sysctl.c @@ -1,4 +1,4 @@ -/* $OpenBSD: kern_sysctl.c,v 1.225 2012/05/30 20:04:52 matthew Exp $ */ +/* $OpenBSD: kern_sysctl.c,v 1.226 2012/06/02 05:44:27 guenther Exp $ */ /* $NetBSD: kern_sysctl.c,v 1.17 1996/05/20 17:49:05 mrg Exp $ */ /*- @@ -1288,7 +1288,7 @@ sysctl_file2(int *name, u_int namelen, char *where, size_t *sizep, * skip system, exiting, embryonic and undead * processes, as well as threads */ - if ((pp->p_flag & (P_SYSTEM | P_WEXIT | P_THREAD)) + if ((pp->p_flag & P_SYSTEM) || (pp->p_flag & P_THREAD) || (pp->p_p->ps_flags & PS_EXITING) || pp->p_stat == SIDL || pp->p_stat == SZOMB) continue; @@ -1320,7 +1320,7 @@ sysctl_file2(int *name, u_int namelen, char *where, size_t *sizep, * skip system, exiting, embryonic and undead * processes, as well as threads */ - if ((pp->p_flag & (P_SYSTEM | P_WEXIT | P_THREAD)) + if ((pp->p_flag & P_SYSTEM) || (pp->p_flag & P_THREAD) || (pp->p_p->ps_flags & PS_EXITING) || pp->p_stat == SIDL || pp->p_stat == SZOMB) continue; |