svn commit: r335576 - head/usr.bin/top
Eitan Adler
eadler at FreeBSD.org
Sat Jun 23 03:17:12 UTC 2018
Author: eadler
Date: Sat Jun 23 03:17:11 2018
New Revision: 335576
URL: https://svnweb.freebsd.org/changeset/base/335576
Log:
top(1): show CPU state breakdown on first run
There is no documented reason for this not to be shown on the first run.
I can't find any good reason, and it breaks batch mode.
PR: 218889
Submitted by: "Jeremy C. Reed" <reed at reedmedia.net>
Modified:
head/usr.bin/top/top.c
Modified: head/usr.bin/top/top.c
==============================================================================
--- head/usr.bin/top/top.c Sat Jun 23 02:42:08 2018 (r335575)
+++ head/usr.bin/top/top.c Sat Jun 23 03:17:11 2018 (r335576)
@@ -243,7 +243,6 @@ main(int argc, char *argv[])
int preset_argc = 0;
const char **av = NULL;
int ac = -1;
- bool dostates = false;
bool do_unames = true;
char interactive = 2;
char warnings = 0;
@@ -641,25 +640,7 @@ restart:
/* display process state breakdown */
(*d_procstates)(system_info.p_total,
system_info.procstates);
-
- /* display the cpu state percentage breakdown */
- if (dostates) /* but not the first time */
- {
- (*d_cpustates)(system_info.cpustates);
- }
- else
- {
- /* we'll do it next time */
- if (smart_terminal)
- {
- z_cpustates();
- }
- else
- {
- putchar('\n');
- }
- dostates = true;
- }
+ (*d_cpustates)(system_info.cpustates);
/* display memory stats */
(*d_memory)(system_info.memory);
More information about the svn-src-head
mailing list