top(1): remove trailing whitespace
This commit is contained in:
parent
ccf22059e0
commit
0ff79d817c
@ -171,7 +171,7 @@ scanint(char *str, int *intp)
|
||||
static struct errs errs[ERRMAX];
|
||||
static int errcnt;
|
||||
static char err_toomany[] = " too many errors occurred";
|
||||
static char err_listem[] =
|
||||
static char err_listem[] =
|
||||
" Many errors occurred. Press `e' to display the list of errors.";
|
||||
|
||||
/* These macros get used to reset and log the errors */
|
||||
@ -403,7 +403,7 @@ kill_procs(char *str)
|
||||
return(invalid_signal_number);
|
||||
}
|
||||
}
|
||||
else
|
||||
else
|
||||
{
|
||||
signum = signame_to_signum(str + 1);
|
||||
|
||||
|
@ -164,7 +164,7 @@ int display_updatecpus(struct statics *statics)
|
||||
{
|
||||
int lines;
|
||||
int i;
|
||||
|
||||
|
||||
/* call resize to do the dirty work */
|
||||
lines = display_resize();
|
||||
if (pcpu_stats)
|
||||
@ -180,10 +180,10 @@ int display_updatecpus(struct statics *statics)
|
||||
for (i = 0; i < num_cpustates * num_cpus; ++i) {
|
||||
lcpustates[i] = -1;
|
||||
}
|
||||
|
||||
|
||||
return(lines);
|
||||
}
|
||||
|
||||
|
||||
int display_init(struct statics * statics)
|
||||
{
|
||||
int lines;
|
||||
@ -220,7 +220,7 @@ int display_init(struct statics * statics)
|
||||
|
||||
arc_names = statics->arc_names;
|
||||
carc_names = statics->carc_names;
|
||||
|
||||
|
||||
/* calculate starting columns where needed */
|
||||
cpustate_total_length = 0;
|
||||
pp = cpustate_names;
|
||||
@ -306,7 +306,7 @@ i_timeofday(time_t *tod)
|
||||
/*
|
||||
* Display the current time.
|
||||
* "ctime" always returns a string that looks like this:
|
||||
*
|
||||
*
|
||||
* Sun Sep 16 01:03:52 1973
|
||||
* 012345678901234567890123
|
||||
* 1 2
|
||||
@ -641,7 +641,7 @@ u_carc(int *stats)
|
||||
summary_format(new, stats, carc_names);
|
||||
line_update(carc_buffer, new, x_carc, y_carc);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* *_swap(stats) - print "Swap: " followed by the swap summary string
|
||||
*
|
||||
@ -1095,7 +1095,7 @@ static void summary_format(char *str, int *numbers, const char * const *names)
|
||||
/* is this number a ratio? */
|
||||
else if (thisname[0] == ':')
|
||||
{
|
||||
(void) snprintf(rbuf, sizeof(rbuf), "%.2f",
|
||||
(void) snprintf(rbuf, sizeof(rbuf), "%.2f",
|
||||
(float)*(numbers - 2) / (float)num);
|
||||
p = stpcpy(p, rbuf);
|
||||
p = stpcpy(p, thisname);
|
||||
@ -1160,7 +1160,7 @@ line_update(char *old, char *new, int start, int line)
|
||||
lastcol = 1;
|
||||
}
|
||||
old++;
|
||||
|
||||
|
||||
/*
|
||||
* main loop -- check each character. If the old and new aren't the
|
||||
* same, then update the display. When the distance from the
|
||||
@ -1201,7 +1201,7 @@ line_update(char *old, char *new, int start, int line)
|
||||
/* already there, update position */
|
||||
lastcol++;
|
||||
}
|
||||
|
||||
|
||||
/* write what we need to */
|
||||
if (ch == '\0')
|
||||
{
|
||||
@ -1216,11 +1216,11 @@ line_update(char *old, char *new, int start, int line)
|
||||
/* put the new character in the screen buffer */
|
||||
*old = ch;
|
||||
}
|
||||
|
||||
|
||||
/* update working column and screen buffer pointer */
|
||||
newcol++;
|
||||
old++;
|
||||
|
||||
|
||||
} while (ch != '\0');
|
||||
|
||||
/* zero out the rest of the line buffer -- MUST BE DONE! */
|
||||
|
@ -294,7 +294,7 @@ main(int argc, char *argv[])
|
||||
ps.jail = false;
|
||||
ps.swap = false;
|
||||
ps.kidle = true;
|
||||
ps.pid = -1;
|
||||
ps.pid = -1;
|
||||
ps.command = NULL;
|
||||
ps.thread_id = false;
|
||||
|
||||
@ -548,7 +548,7 @@ main(int argc, char *argv[])
|
||||
fprintf(stderr, "%s: can't allocate sufficient memory\n", myname);
|
||||
exit(4);
|
||||
}
|
||||
|
||||
|
||||
/* print warning if user requested more processes than we can display */
|
||||
if (topn > max_topn)
|
||||
{
|
||||
@ -617,7 +617,7 @@ main(int argc, char *argv[])
|
||||
{
|
||||
int (*compare)(const void * const, const void * const);
|
||||
|
||||
|
||||
|
||||
/* get the current stats */
|
||||
get_system_info(&system_info);
|
||||
|
||||
@ -673,7 +673,7 @@ main(int argc, char *argv[])
|
||||
|
||||
/* update the header area */
|
||||
(*d_header)(header_text);
|
||||
|
||||
|
||||
if (topn > 0)
|
||||
{
|
||||
/* determine number of processes to actually display */
|
||||
@ -736,7 +736,7 @@ main(int argc, char *argv[])
|
||||
d_process = u_process;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
no_command = true;
|
||||
if (!interactive)
|
||||
{
|
||||
@ -808,7 +808,7 @@ main(int argc, char *argv[])
|
||||
int newval;
|
||||
const char *errmsg;
|
||||
const struct command *cptr;
|
||||
|
||||
|
||||
/* something to read -- clear the message area first */
|
||||
clear_message();
|
||||
|
||||
@ -849,7 +849,7 @@ main(int argc, char *argv[])
|
||||
case CMD_redraw: /* redraw screen */
|
||||
reset_display();
|
||||
break;
|
||||
|
||||
|
||||
case CMD_update: /* merely update display */
|
||||
/* is the load average high? */
|
||||
if (system_info.load_avg[0] > LoadMax)
|
||||
@ -859,11 +859,11 @@ main(int argc, char *argv[])
|
||||
fflush(stdout);
|
||||
}
|
||||
break;
|
||||
|
||||
|
||||
case CMD_quit:
|
||||
quit(0);
|
||||
break;
|
||||
|
||||
|
||||
case CMD_help:
|
||||
reset_display();
|
||||
top_clear();
|
||||
@ -872,7 +872,7 @@ main(int argc, char *argv[])
|
||||
fflush(stdout);
|
||||
read(0, &ch, 1);
|
||||
break;
|
||||
|
||||
|
||||
case CMD_errors: /* show errors */
|
||||
if (error_count() == 0)
|
||||
{
|
||||
@ -891,7 +891,7 @@ main(int argc, char *argv[])
|
||||
read(0, &ch, 1);
|
||||
}
|
||||
break;
|
||||
|
||||
|
||||
case CMD_number:
|
||||
new_message(MT_standout,
|
||||
"Number of processes to show: ");
|
||||
@ -920,7 +920,7 @@ main(int argc, char *argv[])
|
||||
topn = newval;
|
||||
}
|
||||
break;
|
||||
|
||||
|
||||
case CMD_delay: /* new seconds delay */
|
||||
new_message(MT_standout, "Seconds to delay: ");
|
||||
if ((i = readline(tempbuf1, 8, true)) > -1)
|
||||
@ -932,7 +932,7 @@ main(int argc, char *argv[])
|
||||
}
|
||||
clear_message();
|
||||
break;
|
||||
|
||||
|
||||
case CMD_displays: /* change display count */
|
||||
new_message(MT_standout,
|
||||
"Displays to show (currently %s): ",
|
||||
@ -948,7 +948,7 @@ main(int argc, char *argv[])
|
||||
}
|
||||
clear_message();
|
||||
break;
|
||||
|
||||
|
||||
case CMD_kill: /* kill program */
|
||||
new_message(0, "kill ");
|
||||
if (readline(tempbuf2, sizeof(tempbuf2), false) > 0)
|
||||
@ -965,7 +965,7 @@ main(int argc, char *argv[])
|
||||
clear_message();
|
||||
}
|
||||
break;
|
||||
|
||||
|
||||
case CMD_renice: /* renice program */
|
||||
new_message(0, "renice ");
|
||||
if (readline(tempbuf2, sizeof(tempbuf2), false) > 0)
|
||||
@ -1003,7 +1003,7 @@ main(int argc, char *argv[])
|
||||
if (handle_user(tempbuf2, sizeof(tempbuf2)))
|
||||
no_command = true;
|
||||
break;
|
||||
|
||||
|
||||
case CMD_thrtog:
|
||||
ps.thread = !ps.thread;
|
||||
new_message(MT_standout | MT_delayed,
|
||||
@ -1114,7 +1114,7 @@ main(int argc, char *argv[])
|
||||
clear_message();
|
||||
}
|
||||
break;
|
||||
|
||||
|
||||
case CMD_kidletog:
|
||||
ps.kidle = !ps.kidle;
|
||||
new_message(MT_standout | MT_delayed,
|
||||
|
@ -60,7 +60,7 @@ void quit(int);
|
||||
#define LoadMax 5.0
|
||||
|
||||
/*
|
||||
* "Nominal_TOPN" is used as the default TOPN when
|
||||
* "Nominal_TOPN" is used as the default TOPN when
|
||||
* the output is a dumb terminal. If we didn't do this, then
|
||||
* we will get every
|
||||
* process in the system when running top on a dumb terminal (or redirected
|
||||
|
@ -402,6 +402,6 @@ find_pid(pid_t pid)
|
||||
}
|
||||
|
||||
done:
|
||||
kvm_close(kd);
|
||||
kvm_close(kd);
|
||||
return ret;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user