From owner-freebsd-bugs@FreeBSD.ORG Wed Jul 31 05:00:01 2013 Return-Path: Delivered-To: freebsd-bugs@smarthost.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 0C8CCA1 for ; Wed, 31 Jul 2013 05:00:01 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:1900:2254:206c::16:87]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id C739729B3 for ; Wed, 31 Jul 2013 05:00:00 +0000 (UTC) Received: from freefall.freebsd.org (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.7/8.14.7) with ESMTP id r6V500w9076877 for ; Wed, 31 Jul 2013 05:00:00 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.7/8.14.7/Submit) id r6V5004l076876; Wed, 31 Jul 2013 05:00:00 GMT (envelope-from gnats) Resent-Date: Wed, 31 Jul 2013 05:00:00 GMT Resent-Message-Id: <201307310500.r6V5004l076876@freefall.freebsd.org> Resent-From: FreeBSD-gnats-submit@FreeBSD.org (GNATS Filer) Resent-To: freebsd-bugs@FreeBSD.org Resent-Reply-To: FreeBSD-gnats-submit@FreeBSD.org, Danilo Egêa Gondolfo Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 2744CEC7 for ; Wed, 31 Jul 2013 04:52:01 +0000 (UTC) (envelope-from nobody@FreeBSD.org) Received: from oldred.freebsd.org (oldred.freebsd.org [8.8.178.121]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 149D32962 for ; Wed, 31 Jul 2013 04:52:01 +0000 (UTC) Received: from oldred.freebsd.org ([127.0.1.6]) by oldred.freebsd.org (8.14.5/8.14.7) with ESMTP id r6V4q07D034617 for ; Wed, 31 Jul 2013 04:52:00 GMT (envelope-from nobody@oldred.freebsd.org) Received: (from nobody@localhost) by oldred.freebsd.org (8.14.5/8.14.5/Submit) id r6V4q0XM034610; Wed, 31 Jul 2013 04:52:00 GMT (envelope-from nobody) Message-Id: <201307310452.r6V4q0XM034610@oldred.freebsd.org> Date: Wed, 31 Jul 2013 04:52:00 GMT From: Danilo Egêa Gondolfo To: freebsd-gnats-submit@FreeBSD.org X-Send-Pr-Version: www-3.1 Subject: bin/180961: Fix top command format when JID with 4 characters is displayed X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 31 Jul 2013 05:00:01 -0000 >Number: 180961 >Category: bin >Synopsis: Fix top command format when JID with 4 characters is displayed >Confidential: no >Severity: non-critical >Priority: low >Responsible: freebsd-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Wed Jul 31 05:00:00 UTC 2013 >Closed-Date: >Last-Modified: >Originator: Danilo Egêa Gondolfo >Release: FreeBSD 9.2-BETA1 >Organization: >Environment: FreeBSD freebsd 9.2-BETA1 FreeBSD 9.2-BETA1 #7 r253479: Sat Jul 20 06:52:49 BRT 2013 root@freebsd:/usr/obj/usr/src/sys/PROJETO amd64 >Description: When JID is displayed with 4 letters, the screen shows an little bug. You can see it here https://dl.dropboxusercontent.com/u/23276705/top1.png >How-To-Repeat: >Fix: Patch attached with submission follows: --- machine.c.orig 2013-07-31 04:31:38.000000000 -0300 +++ machine.c 2013-07-31 04:29:31.000000000 -0300 @@ -406,7 +406,7 @@ (ps.thread ? smp_header : smp_header_thr) : (ps.thread ? up_header : up_header_thr); snprintf(Header, sizeof(Header), prehead, - ps.jail ? " JID" : "", + ps.jail ? " JID" : "", namelength, namelength, uname_field, ps.wcpu ? "WCPU" : "CPU"); break; @@ -800,7 +800,7 @@ int cpu, state; struct rusage ru, *rup; long p_tot, s_tot; - char *proc_fmt, thr_buf[6], jid_buf[6]; + char *proc_fmt, thr_buf[6], jid_buf[8]; char *cmdbuf = NULL; char **args; >Release-Note: >Audit-Trail: >Unformatted: