From owner-svn-src-head@freebsd.org Wed Jun 13 00:45:37 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EA1351010A42; Wed, 13 Jun 2018 00:45:36 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 9FF8A82790; Wed, 13 Jun 2018 00:45:36 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8131F1236C; Wed, 13 Jun 2018 00:45:36 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w5D0ja3s043624; Wed, 13 Jun 2018 00:45:36 GMT (envelope-from eadler@FreeBSD.org) Received: (from eadler@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5D0jaVk043623; Wed, 13 Jun 2018 00:45:36 GMT (envelope-from eadler@FreeBSD.org) Message-Id: <201806130045.w5D0jaVk043623@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: eadler set sender to eadler@FreeBSD.org using -f From: Eitan Adler Date: Wed, 13 Jun 2018 00:45:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r335023 - head/bin/ps X-SVN-Group: head X-SVN-Commit-Author: eadler X-SVN-Commit-Paths: head/bin/ps X-SVN-Commit-Revision: 335023 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 13 Jun 2018 00:45:37 -0000 Author: eadler Date: Wed Jun 13 00:45:35 2018 New Revision: 335023 URL: https://svnweb.freebsd.org/changeset/base/335023 Log: ps(1): fix some nits - fracmem and mempages are double. ki_rssize should be too - remove default case that is fully covered by all existing cases - mark usage as dead Modified: head/bin/ps/print.c head/bin/ps/ps.c Modified: head/bin/ps/print.c ============================================================================== --- head/bin/ps/print.c Tue Jun 12 23:54:08 2018 (r335022) +++ head/bin/ps/print.c Wed Jun 13 00:45:35 2018 (r335023) @@ -662,7 +662,7 @@ getpmem(KINFO *k) return (0.0); /* XXX want pmap ptpages, segtab, etc. (per architecture) */ /* XXX don't have info about shared */ - fracmem = ((float)k->ki_p->ki_rssize) / mempages; + fracmem = ((double)k->ki_p->ki_rssize) / mempages; return (100.0 * fracmem); } @@ -771,8 +771,6 @@ printval(void *bp, VAR *v) case PGTOK: (void)asprintf(&str, ofmt, ps_pgtok(*(u_long *)bp)); break; - default: - xo_errx(1, "unknown type %d", v->type); } return (str); Modified: head/bin/ps/ps.c ============================================================================== --- head/bin/ps/ps.c Tue Jun 12 23:54:08 2018 (r335022) +++ head/bin/ps/ps.c Wed Jun 13 00:45:35 2018 (r335023) @@ -689,7 +689,7 @@ main(int argc, char *argv[]) (STAILQ_NEXT(vent, next_ve) == NULL && (vent->var->flag & LJUST))) ? 0 : vent->var->width; snprintf(fmtbuf, sizeof(fmtbuf), "{:%s/%%%s%d..%ds}", - vent->var->field ?: vent->var->name, + vent->var->field ? vent->var->field : vent->var->name, (vent->var->flag & LJUST) ? "-" : "", fwidthmin, fwidthmax); xo_emit(fmtbuf, str); @@ -1448,7 +1448,7 @@ pidmax_init(void) } } -static void +static void __dead2 usage(void) { #define SINGLE_OPTS "[-aCcde" OPT_LAZY_f "HhjlmrSTuvwXxZ]"