From 904648debca3a14478ca915c5bf404b0fe9cc6fa Mon Sep 17 00:00:00 2001 From: Theo de Raadt Date: Fri, 11 Jun 2004 16:08:55 +0000 Subject: handle the KI_NOCPU case, pointed out by markus --- usr.bin/top/machine.c | 4 ++-- 1 file 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 @@ -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 -- cgit v1.2.3