Dynamically sense /etc/wall_cmos_clock presence/absense

This commit is contained in:
Andrey A. Chernov 1996-04-05 16:25:38 +00:00
parent 9cb8a1050f
commit c6337b7b46
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=15052

View file

@ -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,14 +312,12 @@ int main(argc, argv)
}
}
if (init) {
mib[0] = CTL_MACHDEP;
mib[1] = CPU_WALLCLOCK;
len = sizeof(wall_clock);
if (sysctl(mib, 2, NULL, NULL, &wall_clock, len) == -1) {
syslog(LOG_ERR, "sysctl(put_wallclock): %m");
return 1;
}
mib[0] = CTL_MACHDEP;
mib[1] = CPU_WALLCLOCK;
len = sizeof(wall_clock);
if (sysctl(mib, 2, NULL, NULL, &wall_clock, len) == -1) {
syslog(LOG_ERR, "sysctl(put_wallclock): %m");
return 1;
}
if (need_restore) {