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" <[email protected]>
This commit is contained in:
Eitan Adler committed 2018-06-23 03:17:11 +00:00
1 parent 6014f3c446
commit becfb1625c
1 file changed
+1 -20
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=335576
+1 -20
View File
@@ -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);