Use sysctlbyname() instead of sysctl

This commit is contained in:
Poul-Henning Kamp 2006-05-11 17:23:57 +00:00
parent 29886d86de
commit 31048bda0e
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=158443

View file

@ -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(&ltime);