Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 9 Jan 2017 00:29:23 +0000 (UTC)
From:      Ngie Cooper <ngie@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r311710 - head/usr.bin/top
Message-ID:  <201701090029.v090TNOf068860@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: ngie
Date: Mon Jan  9 00:29:23 2017
New Revision: 311710
URL: https://svnweb.freebsd.org/changeset/base/311710

Log:
  Style fixes
  
  - Delete trailing whitespace
  - Use nitems(mib) instead of hardcoding the mib length
  
  MFC after:	3 days

Modified:
  head/usr.bin/top/machine.c

Modified: head/usr.bin/top/machine.c
==============================================================================
--- head/usr.bin/top/machine.c	Mon Jan  9 00:25:33 2017	(r311709)
+++ head/usr.bin/top/machine.c	Mon Jan  9 00:29:23 2017	(r311710)
@@ -413,7 +413,7 @@ format_header(char *uname_field)
 {
 	static char Header[128];
 	const char *prehead;
-	
+
 	if (ps.jail)
 		jidlength = TOP_JID_LEN + 1;	/* +1 for extra left space. */
 	else
@@ -559,7 +559,7 @@ get_system_info(struct system_info *si)
 		arc_stats[5] = arc_stat >> 10;
 		si->arc = arc_stats;
 	}
-		    
+
 	/* set arrays and strings */
 	if (pcpu_stats) {
 		si->cpustates = pcpu_cpu_states;
@@ -585,7 +585,7 @@ get_system_info(struct system_info *si)
 	mib[0] = CTL_KERN;
 	mib[1] = KERN_BOOTTIME;
 	size = sizeof(boottime);
-	if (sysctl(mib, 2, &boottime, &size, NULL, 0) != -1 &&
+	if (sysctl(mib, nitems(mib), &boottime, &size, NULL, 0) != -1 &&
 	    boottime.tv_sec != 0) {
 		si->boottime = boottime;
 	} else {
@@ -1072,7 +1072,7 @@ format_next_process(caddr_t handle, char
 		}
 	}
 
-	if (ps.jail == 0) 
+	if (ps.jail == 0)
 		jid_buf[0] = '\0';
 	else
 		snprintf(jid_buf, sizeof(jid_buf), "%*d",



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201701090029.v090TNOf068860>