Dynamically sense /etc/wall_cmos_clock presence/absense
This commit is contained in:
parent
9cb8a1050f
commit
c6337b7b46
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=15052
@ -122,18 +122,6 @@ int main(argc, argv)
|
||||
return 1;
|
||||
}
|
||||
|
||||
if (init)
|
||||
wall_clock = (access(_PATH_CLOCK, F_OK) == 0);
|
||||
else {
|
||||
mib[0] = CTL_MACHDEP;
|
||||
mib[1] = CPU_WALLCLOCK;
|
||||
len = sizeof(wall_clock);
|
||||
if (sysctl(mib, 2, &wall_clock, &len, NULL, 0) == -1) {
|
||||
syslog(LOG_ERR, "sysctl(get_wallclock): %m");
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
|
||||
again:
|
||||
(void) sigprocmask(SIG_BLOCK, &mask, NULL);
|
||||
(void) signal(SIGTERM, fake);
|
||||
@ -143,6 +131,8 @@ int main(argc, argv)
|
||||
stz = NULL;
|
||||
looping = False;
|
||||
|
||||
wall_clock = (access(_PATH_CLOCK, F_OK) == 0);
|
||||
|
||||
mib[0] = CTL_MACHDEP;
|
||||
mib[1] = CPU_ADJKERNTZ;
|
||||
len = sizeof(kern_offset);
|
||||
@ -322,7 +312,6 @@ int main(argc, argv)
|
||||
}
|
||||
}
|
||||
|
||||
if (init) {
|
||||
mib[0] = CTL_MACHDEP;
|
||||
mib[1] = CPU_WALLCLOCK;
|
||||
len = sizeof(wall_clock);
|
||||
@ -330,7 +319,6 @@ int main(argc, argv)
|
||||
syslog(LOG_ERR, "sysctl(put_wallclock): %m");
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
|
||||
if (need_restore) {
|
||||
need_restore = False;
|
||||
|
Loading…
Reference in New Issue
Block a user