Remove trailing whitespace and use nitems(mib)
instead of 2
when
calling sysctl(3) MFC after: 3 days Sponsored by: EMC / Isilon Storage Division
This commit is contained in:
parent
410757a4f4
commit
6ea709b588
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=298303
@ -53,7 +53,7 @@ __FBSDID("$FreeBSD$");
|
||||
int
|
||||
getpagesize(void)
|
||||
{
|
||||
int mib[2];
|
||||
int mib[2];
|
||||
static int value;
|
||||
size_t size;
|
||||
int error;
|
||||
@ -68,7 +68,7 @@ getpagesize(void)
|
||||
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);
|
||||
|
Loading…
Reference in New Issue
Block a user