From owner-cvs-src@FreeBSD.ORG Mon May 16 10:03:48 2005 Return-Path: Delivered-To: cvs-src@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id A6DC216A4DF; Mon, 16 May 2005 10:03:48 +0000 (GMT) Received: from kane.otenet.gr (kane.otenet.gr [195.170.0.27]) by mx1.FreeBSD.org (Postfix) with ESMTP id DADC243D80; Mon, 16 May 2005 10:03:47 +0000 (GMT) (envelope-from keramida@freebsd.org) Received: from orion.daedalusnetworks.priv (aris.bedc.ondsl.gr [62.103.39.226])j4GA229m004837; Mon, 16 May 2005 13:02:03 +0300 Received: from orion.daedalusnetworks.priv (orion [127.0.0.1]) j4GA3ioO078966; Mon, 16 May 2005 13:03:44 +0300 (EEST) (envelope-from keramida@freebsd.org) Received: (from keramida@localhost)j4GA3iEO078965; Mon, 16 May 2005 13:03:44 +0300 (EEST) (envelope-from keramida@freebsd.org) Date: Mon, 16 May 2005 13:03:44 +0300 From: Giorgos Keramidas To: "David O'Brien" Message-ID: <20050516100344.GA78277@orion.daedalusnetworks.priv> References: <200504161543.j3GFhclO075103@repoman.freebsd.org> <20050516001837.GA65506@dragon.NUXI.org> <20050516004059.GA15002@gothmog.gr> <20050516032743.GA89903@dragon.NUXI.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20050516032743.GA89903@dragon.NUXI.org> cc: cvs-src@freebsd.org cc: src-committers@freebsd.org cc: cvs-all@freebsd.org Subject: Re: cvs commit: src/usr.bin/top machine.c X-BeenThere: cvs-src@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: CVS commit messages for the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 May 2005 10:03:48 -0000 On 2005-05-15 20:27, David O'Brien wrote: >On Mon, May 16, 2005 at 03:40:59AM +0300, Giorgos Keramidas wrote: >> On 2005-05-15 17:18, David O'Brien wrote: >> >On Sat, Apr 16, 2005 at 03:43:38PM +0000, Giorgos Keramidas wrote: >> >> Reduce the width of the THR column to 4 characters, to avoid wrap-around >> >> of lines in SMP machines (which are wider), until we have a better way >> >> of handling window sizes & columns in top. >> >> >> >> Caught by: ache, Andre Guibert de Bruet >> >> Point hat: keramida >> >> >> >> Revision Changes Path >> >> 1.71 +5 -5 src/usr.bin/top/machine.c >> > >> > Please back machine.c back to revsion 1.69, ASAP. >> > The current top is redicious: >..snip.. >> Your USERNAME column is too wide (12 columns). Do you happen to have >> very long names? > > The dovecot port adds a the 'dovecot-auth' user. The top(1) code > supports 13 character usernames on SMP systems and 15 on UP systems. > Your rev 1.70-1.71 changes failed to take that into account. > >> If that is true, would it be ok to wait 1-2 days until I have a >> machine.c version that prints USERNAME using only 8 columns instead of >> using arbitrarily long columns, like now? > > I don't know why to wait 1-2 days. I made the change in 1 minute. For various reasons: - Because I'm not an src-committer, so I have to get a review from a real src committer before I commit stuff. - Because I want to test the change and be sure it doesn't break anything else. - Because when I replied it was already 04:00am here, and it's not a good idea to hack on source after being up for too long. > Or is there debate if that change will be acceptable? If there isn't > a debate about it, let me know and I'll commit this diff. - That could be true too. I haven't asked anyone else for their opinion. I only made the same change locally & run off to bed :-) > --- machine.c 16 Apr 2005 15:43:38 -0000 1.71 > +++ machine.c 16 May 2005 03:25:20 -0000 > @@ -60,7 +60,7 @@ > int swapmode(int *retavail, int *retfree); > static int smpmode; > enum displaymodes displaymode; > -static int namelength; > +static int namelength = 8; > static int cmdlengthdelta; > > /* Prototypes for top internals */ > @@ -233,17 +233,6 @@ > modelen != sizeof(smpmode)) > smpmode = 0; > > - while ((pw = getpwent()) != NULL) { > - if (strlen(pw->pw_name) > namelength) > - namelength = strlen(pw->pw_name); > - } > - if (namelength < 8) > - namelength = 8; > - if (smpmode && namelength > 13) > - namelength = 13; > - else if (namelength > 15) > - namelength = 15; > - > kd = kvm_open(NULL, _PATH_DEVNULL, NULL, O_RDONLY, "kvm_open"); > if (kd == NULL) > return (-1); This seems ok, AFAICT.