Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 29 Oct 2014 19:21:20 +0000 (UTC)
From:      Jung-uk Kim <jkim@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r273835 - head/usr.bin/top
Message-ID:  <201410291921.s9TJLKpg005878@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: jkim
Date: Wed Oct 29 19:21:19 2014
New Revision: 273835
URL: https://svnweb.freebsd.org/changeset/base/273835

Log:
  Replace a magic number with the proper definition.  This change actually
  fixes broken state field after r273266, i.e., "CPU-1" was displayed in place
  of "RUN".

Modified:
  head/usr.bin/top/machine.c

Modified: head/usr.bin/top/machine.c
==============================================================================
--- head/usr.bin/top/machine.c	Wed Oct 29 18:01:09 2014	(r273834)
+++ head/usr.bin/top/machine.c	Wed Oct 29 19:21:19 2014	(r273835)
@@ -941,7 +941,7 @@ format_next_process(caddr_t handle, char
 	/* generate "STATE" field */
 	switch (state = pp->ki_stat) {
 	case SRUN:
-		if (smpmode && pp->ki_oncpu != 0xff)
+		if (smpmode && pp->ki_oncpu != NOCPU)
 			sprintf(status, "CPU%d", pp->ki_oncpu);
 		else
 			strcpy(status, "RUN");
@@ -1100,7 +1100,7 @@ format_next_process(caddr_t handle, char
 
 	/* format this entry */
 	if (smpmode) {
-		if (state == SRUN && pp->ki_oncpu != 0xff)
+		if (state == SRUN && pp->ki_oncpu != NOCPU)
 			cpu = pp->ki_oncpu;
 		else
 			cpu = pp->ki_lastcpu;



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201410291921.s9TJLKpg005878>