From owner-svn-src-head@freebsd.org Tue Jun 12 07:32:01 2018 Return-Path: Delivered-To: svn-src-head@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 F420910079F3; Tue, 12 Jun 2018 07:32:00 +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 A98F272AB1; Tue, 12 Jun 2018 07:32:00 +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 8AA25275FD; Tue, 12 Jun 2018 07:32:00 +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 w5C7W0Vf013680; Tue, 12 Jun 2018 07:32:00 GMT (envelope-from eadler@FreeBSD.org) Received: (from eadler@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5C7VxRl013670; Tue, 12 Jun 2018 07:31:59 GMT (envelope-from eadler@FreeBSD.org) Message-Id: <201806120731.w5C7VxRl013670@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: eadler set sender to eadler@FreeBSD.org using -f From: Eitan Adler Date: Tue, 12 Jun 2018 07:31:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r334990 - 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: 334990 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 12 Jun 2018 07:32:01 -0000 Author: eadler Date: Tue Jun 12 07:31:59 2018 New Revision: 334990 URL: https://svnweb.freebsd.org/changeset/base/334990 Log: top(1): remove trailing whitespace Modified: head/usr.bin/top/commands.c head/usr.bin/top/display.c head/usr.bin/top/top.c head/usr.bin/top/top.h head/usr.bin/top/utils.c Modified: head/usr.bin/top/commands.c ============================================================================== --- head/usr.bin/top/commands.c Tue Jun 12 07:14:12 2018 (r334989) +++ head/usr.bin/top/commands.c Tue Jun 12 07:31:59 2018 (r334990) @@ -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); Modified: head/usr.bin/top/display.c ============================================================================== --- head/usr.bin/top/display.c Tue Jun 12 07:14:12 2018 (r334989) +++ head/usr.bin/top/display.c Tue Jun 12 07:31:59 2018 (r334990) @@ -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, co /* 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! */ Modified: head/usr.bin/top/top.c ============================================================================== --- head/usr.bin/top/top.c Tue Jun 12 07:14:12 2018 (r334989) +++ head/usr.bin/top/top.c Tue Jun 12 07:31:59 2018 (r334990) @@ -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 @@ restart: { int (*compare)(const void * const, const void * const); - + /* get the current stats */ get_system_info(&system_info); @@ -673,7 +673,7 @@ restart: /* update the header area */ (*d_header)(header_text); - + if (topn > 0) { /* determine number of processes to actually display */ @@ -736,7 +736,7 @@ restart: d_process = u_process; } } - + no_command = true; if (!interactive) { @@ -808,7 +808,7 @@ restart: int newval; const char *errmsg; const struct command *cptr; - + /* something to read -- clear the message area first */ clear_message(); @@ -849,7 +849,7 @@ restart: 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 @@ restart: fflush(stdout); } break; - + case CMD_quit: quit(0); break; - + case CMD_help: reset_display(); top_clear(); @@ -872,7 +872,7 @@ restart: fflush(stdout); read(0, &ch, 1); break; - + case CMD_errors: /* show errors */ if (error_count() == 0) { @@ -891,7 +891,7 @@ restart: read(0, &ch, 1); } break; - + case CMD_number: new_message(MT_standout, "Number of processes to show: "); @@ -920,7 +920,7 @@ restart: 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 @@ restart: } clear_message(); break; - + case CMD_displays: /* change display count */ new_message(MT_standout, "Displays to show (currently %s): ", @@ -948,7 +948,7 @@ restart: } clear_message(); break; - + case CMD_kill: /* kill program */ new_message(0, "kill "); if (readline(tempbuf2, sizeof(tempbuf2), false) > 0) @@ -965,7 +965,7 @@ restart: clear_message(); } break; - + case CMD_renice: /* renice program */ new_message(0, "renice "); if (readline(tempbuf2, sizeof(tempbuf2), false) > 0) @@ -1003,7 +1003,7 @@ restart: 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 @@ restart: clear_message(); } break; - + case CMD_kidletog: ps.kidle = !ps.kidle; new_message(MT_standout | MT_delayed, Modified: head/usr.bin/top/top.h ============================================================================== --- head/usr.bin/top/top.h Tue Jun 12 07:14:12 2018 (r334989) +++ head/usr.bin/top/top.h Tue Jun 12 07:31:59 2018 (r334990) @@ -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 Modified: head/usr.bin/top/utils.c ============================================================================== --- head/usr.bin/top/utils.c Tue Jun 12 07:14:12 2018 (r334989) +++ head/usr.bin/top/utils.c Tue Jun 12 07:31:59 2018 (r334990) @@ -402,6 +402,6 @@ find_pid(pid_t pid) } done: - kvm_close(kd); + kvm_close(kd); return ret; }