From owner-svn-src-all@FreeBSD.ORG Sat Nov 1 13:40:46 2008 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B976E1065672; Sat, 1 Nov 2008 13:40:46 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A9A208FC1A; Sat, 1 Nov 2008 13:40:46 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mA1DekCT010310; Sat, 1 Nov 2008 13:40:46 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mA1Dekxr010308; Sat, 1 Nov 2008 13:40:46 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <200811011340.mA1Dekxr010308@svn.freebsd.org> From: Ed Schouten Date: Sat, 1 Nov 2008 13:40:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r184522 - in head: sys/kern usr.sbin/pstat X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 01 Nov 2008 13:40:46 -0000 Author: ed Date: Sat Nov 1 13:40:46 2008 New Revision: 184522 URL: http://svn.freebsd.org/changeset/base/184522 Log: Clamp the values of t_column to 5 digits in `pstat -t' and `show all ttys'. We often run into these very high column numbers when we run curses applications, because they don't print any newlines. This messes up the table output of `pstat -t'. If these numbers get really high, they aren't of any use to the reader anyway. Convert them to `99999' when they run out of bounds. Modified: head/sys/kern/tty.c head/usr.sbin/pstat/pstat.c Modified: head/sys/kern/tty.c ============================================================================== --- head/sys/kern/tty.c Sat Nov 1 08:35:28 2008 (r184521) +++ head/sys/kern/tty.c Sat Nov 1 13:40:46 2008 (r184522) @@ -2007,7 +2007,7 @@ DB_SHOW_ALL_COMMAND(ttys, db_show_all_tt osiz, tp->t_outq.to_end - tp->t_outq.to_begin, osiz - tp->t_outlow, - tp->t_column, + MIN(tp->t_column, 99999), tp->t_session ? tp->t_session->s_sid : 0, tp->t_pgrp ? tp->t_pgrp->pg_id : 0); Modified: head/usr.sbin/pstat/pstat.c ============================================================================== --- head/usr.sbin/pstat/pstat.c Sat Nov 1 08:35:28 2008 (r184521) +++ head/usr.sbin/pstat/pstat.c Sat Nov 1 13:40:46 2008 (r184522) @@ -334,7 +334,7 @@ ttyprt(struct xtty *xt) xt->xt_insize, xt->xt_incc, xt->xt_inlc, (xt->xt_insize - xt->xt_inlow), xt->xt_outsize, xt->xt_outcc, (xt->xt_outsize - xt->xt_outlow), - xt->xt_column, xt->xt_sid, xt->xt_pgid); + MIN(xt->xt_column, 99999), xt->xt_sid, xt->xt_pgid); for (i = j = 0; ttystates[i].flag; i++) if (xt->xt_flags & ttystates[i].flag) { putchar(ttystates[i].val);