Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 24 Oct 2000 02:05:12 -0700 (PDT)
From:      williamc@go2net.com
To:        FreeBSD-gnats-submit@freebsd.org
Subject:   bin/22270: top wraps wrong for some SMP systems
Message-ID:  <20001024090512.2233CD5D0@gasket.go2net.com>

next in thread | raw e-mail | index | archive | help

>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:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Tue Oct 24 02:10:03 PDT 2000
>Closed-Date:
>Last-Modified:
>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:
>Unformatted:


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-bugs" in the body of the message




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