From williamc@go2net.com  Tue Oct 24 02:05:17 2000
Return-Path: <williamc@go2net.com>
Received: from gasket.go2net.com (natbox.go2net.com [209.191.181.146])
	by hub.freebsd.org (Postfix) with ESMTP id 16E1C37B479
	for <FreeBSD-gnats-submit@freebsd.org>; Tue, 24 Oct 2000 02:05:17 -0700 (PDT)
Received: by gasket.go2net.com (Postfix, from userid 492)
	id 2233CD5D0; Tue, 24 Oct 2000 02:05:12 -0700 (PDT)
Message-Id: <20001024090512.2233CD5D0@gasket.go2net.com>
Date: Tue, 24 Oct 2000 02:05:12 -0700 (PDT)
From: williamc@go2net.com
Reply-To: williamc@go2net.com
To: FreeBSD-gnats-submit@freebsd.org
Subject: top wraps wrong for some SMP systems
X-Send-Pr-Version: 3.2

>Number:         22270
>Category:       bin
>Synopsis:       [patch] /usr/bin/top wraps wrong w/SMP on and long usernames
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    freebsd-bugs
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Tue Oct 24 02:10:03 PDT 2000
>Closed-Date:    Tue May 8 16:58:30 PDT 2001
>Last-Modified:  Tue May 08 16:58:46 PDT 2001
>Originator:     William Carrel
>Release:        FreeBSD 4.1.1-STABLE i386
>Organization:
InfoSpace, Inc.
>Environment:

	Any FreeBSD SMP system, from since the beginning of time.

>Description:

	/usr/bin/top was reduced to 15 characters max in 1.29 by davidn
	however this is not enough for SMP systems who have one more 
	column of text that indicates CPU number.  With SMP enabled these
	systems need a username of max 13 characters to avoid the 
	unattractive wrapping.

>How-To-Repeat:

	Run /usr/bin/top on a SMP system with SMP on and a username of 14
	or more characters.

>Fix:

	The following patch applied to /usr/src/usr.bin/top/machine.c will
	correct this problem.  This patch is for 4.X-STABLE (1.29).  But the 
	affected code is still identical in 5-CURRENT (1.30).  Both versions
	need the patch, as well as 3.X-STABLE (1.18.2.4).  Cheers!

*** machine.c.orig	Tue Oct 24 01:35:54 2000
--- machine.c	Tue Oct 24 01:39:15 2000
***************
*** 241,247 ****
      }
      if (namelength < 8)
  	namelength = 8;
!     if (namelength > 15)
  	namelength = 15;
  
      if ((kd = kvm_open(NULL, NULL, NULL, O_RDONLY, "kvm_open")) == NULL)
--- 241,249 ----
      }
      if (namelength < 8)
  	namelength = 8;
!     if (smpmode && namelength > 13)
!         namelength = 13;
!     else if (namelength > 15)
  	namelength = 15;
  
      if ((kd = kvm_open(NULL, NULL, NULL, O_RDONLY, "kvm_open")) == NULL)



>Release-Note:
>Audit-Trail:
State-Changed-From-To: open->suspended 
State-Changed-By: will 
State-Changed-When: Sun Mar 11 21:54:30 PST 2001 
State-Changed-Why:  
Committed to 5.0-CURRENT, thanks!  This serves as a reminder to 
commit this patch to RELENG_4 after 4.3-RELEASE. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=22270 
State-Changed-From-To: suspended->closed 
State-Changed-By: will 
State-Changed-When: Tue May 8 16:58:30 PDT 2001 
State-Changed-Why:  
MFC'd to RELENG_4 about 10 minutes ago.  Thanks. 

http://www.FreeBSD.org/cgi/query-pr.cgi?pr=22270 
>Unformatted:
