summaryrefslogtreecommitdiffstats
path: root/usr.bin/pkill
diff options
context:
space:
mode:
authorgad <gad@FreeBSD.org>2004-03-30 15:10:50 +0000
committergad <gad@FreeBSD.org>2004-03-30 15:10:50 +0000
commit44647935be85125630b72277c30e4c81d6d28809 (patch)
tree32153ebc6af809af46311f51500d1c0e36150e41 /usr.bin/pkill
parent6fe56e6c8043ea73267fd451277b175ca58be056 (diff)
downloadFreeBSD-src-44647935be85125630b72277c30e4c81d6d28809.zip
FreeBSD-src-44647935be85125630b72277c30e4c81d6d28809.tar.gz
Use KERN_PROC_PROC instead of KERN_PROC_ALL on the call to kvm_getprocs(),
so we get one line per process instead of one for each kernel-thread. Noticed by: ache & tjr
Diffstat (limited to 'usr.bin/pkill')
-rw-r--r--usr.bin/pkill/pkill.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/usr.bin/pkill/pkill.c b/usr.bin/pkill/pkill.c
index 4443416..565dc3c 100644
--- a/usr.bin/pkill/pkill.c
+++ b/usr.bin/pkill/pkill.c
@@ -260,7 +260,11 @@ main(int argc, char **argv)
if (kd == NULL)
errx(STATUS_ERROR, "kvm_openfiles(): %s", buf);
- plist = kvm_getprocs(kd, KERN_PROC_ALL, 0, &nproc);
+ /*
+ * Use KERN_PROC_PROC instead of KERN_PROC_ALL, since we
+ * just want processes and not individual kernel threads.
+ */
+ plist = kvm_getprocs(kd, KERN_PROC_PROC, 0, &nproc);
if (plist == NULL)
errx(STATUS_ERROR, "kvm_getprocs() failed");
OpenPOWER on IntegriCloud