Use sysctlbyname() instead of sysctl
This commit is contained in:
parent
1fe559753b
commit
8777f94272
@ -81,7 +81,6 @@ main(int argc, char *argv[]) {
|
||||
time_t ltime;
|
||||
int opt, error, mntflags, nlsopt, wall_clock;
|
||||
size_t len;
|
||||
int mib[2];
|
||||
char *p, *p1, tmp[1024];
|
||||
u_char *pv;
|
||||
|
||||
@ -309,10 +308,8 @@ main(int argc, char *argv[]) {
|
||||
/* }*/
|
||||
mdata.nls.opt = nlsopt;
|
||||
|
||||
mib[0] = CTL_MACHDEP;
|
||||
mib[1] = CPU_WALLCLOCK;
|
||||
len = sizeof(wall_clock);
|
||||
if (sysctl(mib, 2, &wall_clock, &len, NULL, 0) == -1)
|
||||
if (sysctlbyname("machdep.wall_cmos_clock", &wall_clock, &len, NULL, 0) == -1)
|
||||
err(EX_OSERR, "get wall_clock");
|
||||
if (wall_clock == 0) {
|
||||
time(<ime);
|
||||
|
Loading…
x
Reference in New Issue
Block a user