summaryrefslogtreecommitdiff
path: root/usr.bin/top/machine.c
diff options
context:
space:
mode:
authorTheo de Raadt <deraadt@cvs.openbsd.org>2004-06-11 16:08:55 +0000
committerTheo de Raadt <deraadt@cvs.openbsd.org>2004-06-11 16:08:55 +0000
commit904648debca3a14478ca915c5bf404b0fe9cc6fa (patch)
tree4c4e5e8b8cfc57af404022ac86fcb76d0da9f535 /usr.bin/top/machine.c
parent9f7e3d1b4219ea8a91ad3ba3dbe600fd8168e8f6 (diff)
handle the KI_NOCPU case, pointed out by markus
Diffstat (limited to 'usr.bin/top/machine.c')
-rw-r--r--usr.bin/top/machine.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/usr.bin/top/machine.c b/usr.bin/top/machine.c
index 1f2cef12024..020f6a2d7c7 100644
--- a/usr.bin/top/machine.c
+++ b/usr.bin/top/machine.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: machine.c,v 1.41 2004/06/11 05:29:28 deraadt Exp $ */
+/* $OpenBSD: machine.c,v 1.42 2004/06/11 16:08:54 deraadt Exp $ */
/*-
* Copyright (c) 1994 Thorsten Lockert <tholo@sigmasoft.com>
@@ -377,7 +377,7 @@ state_abbr(struct kinfo_proc2 *pp)
{
static char buf[10];
- if (ncpu > 1)
+ if (ncpu > 1 && pp->p_cpuid != KI_NOCPU)
snprintf(buf, sizeof buf, "%s/%d",
state_abbrev[(unsigned char)pp->p_stat], pp->p_cpuid);
else