Date: Mon, 21 May 2018 04:02:46 +0000 (UTC) From: Eitan Adler <eadler@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r333960 - head/usr.bin/top Message-ID: <201805210402.w4L42kB2086366@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
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 <vis.h> #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 : \
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201805210402.w4L42kB2086366>