Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 22 Apr 2016 21:28:50 +0000 (UTC)
From:      Garrett Cooper <ngie@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org
Subject:   svn commit: r298489 - stable/9/lib/libc/gen
Message-ID:  <201604222128.u3MLSoGM082275@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: ngie
Date: Fri Apr 22 21:28:50 2016
New Revision: 298489
URL: https://svnweb.freebsd.org/changeset/base/298489

Log:
  MFstable/10 r298488:
  
  MFC r298303:
  
  Remove trailing whitespace and use `nitems(mib)` instead of `2` when
  calling sysctl(3)

Modified:
  stable/9/lib/libc/gen/getpagesize.c
Directory Properties:
  stable/9/   (props changed)
  stable/9/lib/   (props changed)
  stable/9/lib/libc/   (props changed)

Modified: stable/9/lib/libc/gen/getpagesize.c
==============================================================================
--- stable/9/lib/libc/gen/getpagesize.c	Fri Apr 22 21:26:15 2016	(r298488)
+++ stable/9/lib/libc/gen/getpagesize.c	Fri Apr 22 21:28:50 2016	(r298489)
@@ -53,7 +53,7 @@ __FBSDID("$FreeBSD$");
 int
 getpagesize()
 {
-	int mib[2]; 
+	int mib[2];
 	static int value;
 	size_t size;
 	int error;
@@ -68,7 +68,7 @@ getpagesize()
 	mib[0] = CTL_HW;
 	mib[1] = HW_PAGESIZE;
 	size = sizeof value;
-	if (sysctl(mib, 2, &value, &size, NULL, 0) == -1)
+	if (sysctl(mib, nitems(mib), &value, &size, NULL, 0) == -1)
 		return (-1);
 
 	return (value);



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