From efc96764e08d591aca3d0802b15d5676315daafb Mon Sep 17 00:00:00 2001 From: Bruce Evans Date: Fri, 5 Mar 1999 16:38:13 +0000 Subject: The magic "no-cpu" cpu number is 0xff. Don't misrepresent cpu numbers as chars or use bogus casts in an attempt to unmisrepresnt them. In top, don't assume that 0xff is the only negative cpu number when cpu numbers are (mis)represented. --- usr.bin/top/machine.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'usr.bin/top') diff --git a/usr.bin/top/machine.c b/usr.bin/top/machine.c index 6aabe8adf41f..d64d494e128c 100644 --- a/usr.bin/top/machine.c +++ b/usr.bin/top/machine.c @@ -19,7 +19,7 @@ * Steven Wallace * Wolfram Schneider * - * $Id: machine.c,v 1.20 1999/02/06 06:33:55 dillon Exp $ + * $Id: machine.c,v 1.21 1999/02/06 16:58:50 fenner Exp $ */ @@ -584,7 +584,7 @@ char *(*get_userid)(); /* generate "STATE" field */ switch (state = PP(pp, p_stat)) { case SRUN: - if (smpmode && PP(pp, p_oncpu) >= 0) + if (smpmode && PP(pp, p_oncpu) == 0xff) sprintf(status, "CPU%d", PP(pp, p_oncpu)); else strcpy(status, "RUN"); -- cgit v1.2.3