From owner-svn-src-all@freebsd.org Mon May 21 04:02:47 2018 Return-Path: Delivered-To: svn-src-all@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 775FBEDB9E0; Mon, 21 May 2018 04:02:47 +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 1E20D6B2C8; Mon, 21 May 2018 04:02:47 +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 F20AC1FE1E; Mon, 21 May 2018 04:02:46 +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 w4L42kKE086369; Mon, 21 May 2018 04:02:46 GMT (envelope-from eadler@FreeBSD.org) Received: (from eadler@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w4L42kB2086366; Mon, 21 May 2018 04:02:46 GMT (envelope-from eadler@FreeBSD.org) Message-Id: <201805210402.w4L42kB2086366@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: eadler set sender to eadler@FreeBSD.org using -f From: Eitan Adler Date: Mon, 21 May 2018 04:02:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r333960 - head/usr.bin/top X-SVN-Group: head X-SVN-Commit-Author: eadler X-SVN-Commit-Paths: head/usr.bin/top X-SVN-Commit-Revision: 333960 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.26 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: Mon, 21 May 2018 04:02:47 -0000 Author: eadler Date: Mon May 21 04:02:45 2018 New Revision: 333960 URL: https://svnweb.freebsd.org/changeset/base/333960 Log: top(1): further unconditionally assume we're on FreeBSD Modified: head/usr.bin/top/commands.c head/usr.bin/top/display.c head/usr.bin/top/display.h head/usr.bin/top/machine.c Modified: head/usr.bin/top/commands.c ============================================================================== --- head/usr.bin/top/commands.c Mon May 21 03:58:15 2018 (r333959) +++ head/usr.bin/top/commands.c Mon May 21 04:02:45 2018 (r333960) @@ -489,13 +489,11 @@ renice_procs(char *str) prio = -prio; } -#if defined(PRIO_MIN) && defined(PRIO_MAX) /* check for validity */ if (procnum == -1 || prio < PRIO_MIN || prio > PRIO_MAX) { return(" bad priority value"); } -#endif /* move to the first process number */ if ((str = next_field(str)) == NULL) Modified: head/usr.bin/top/display.c ============================================================================== --- head/usr.bin/top/display.c Mon May 21 03:58:15 2018 (r333959) +++ head/usr.bin/top/display.c Mon May 21 04:02:45 2018 (r333960) @@ -441,40 +441,6 @@ int *brkdn; } } -#ifdef no_more -/* - * *_cpustates(states, names) - print the cpu state percentages - * - * Assumptions: cursor is on the PREVIOUS line - */ - -/* cpustates_tag() calculates the correct tag to use to label the line */ - -char *cpustates_tag() - -{ - char *use; - - static char *short_tag = "CPU: "; - static char *long_tag = "CPU states: "; - - /* if length + strlen(long_tag) >= screen_width, then we have to - use the shorter tag (we subtract 2 to account for ": ") */ - if (cpustate_total_length + (int)strlen(long_tag) - 2 >= screen_width) - { - use = short_tag; - } - else - { - use = long_tag; - } - - /* set cpustates_column accordingly then return result */ - cpustates_column = strlen(use); - return(use); -} -#endif - void i_cpustates(states) Modified: head/usr.bin/top/display.h ============================================================================== --- head/usr.bin/top/display.h Mon May 21 03:58:15 2018 (r333959) +++ head/usr.bin/top/display.h Mon May 21 04:02:45 2018 (r333960) @@ -13,7 +13,6 @@ void clear_message(void); int display_resize(void); void i_header(char *text); char *printable(char *string); -char *cpustates_tag(void); void display_header(int t); int display_init(struct statics *statics); void i_arc(int *stats); Modified: head/usr.bin/top/machine.c ============================================================================== --- head/usr.bin/top/machine.c Mon May 21 03:58:15 2018 (r333959) +++ head/usr.bin/top/machine.c Mon May 21 04:02:45 2018 (r333960) @@ -42,8 +42,9 @@ #include #include "top.h" -#include "machine.h" #include "display.h" +#include "machine.h" +#include "loadavg.h" #include "screen.h" #include "utils.h" #include "layout.h" @@ -56,11 +57,7 @@ extern struct process_select ps; extern struct timeval timeout; static int smpmode; enum displaymodes displaymode; -#ifdef TOP_USERNAME_LEN -static int namelength = TOP_USERNAME_LEN; -#else static int namelength = 8; -#endif /* TOP_JID_LEN based on max of 999999 */ #define TOP_JID_LEN 7 #define TOP_SWAP_LEN 6 @@ -75,8 +72,6 @@ struct handle { int remaining; /* number of pointers remaining */ }; -/* declarations for load_avg */ -#include "loadavg.h" /* define what weighted cpu is. */ #define weighted_cpu(pct, pp) ((pp)->ki_swtime == 0 ? 0.0 : \