aboutsummaryrefslogtreecommitdiff
path: root/sbin/adjkerntz/adjkerntz.c
diff options
context:
space:
mode:
authorAndrey A. Chernov <ache@FreeBSD.org>1996-04-05 16:25:38 +0000
committerAndrey A. Chernov <ache@FreeBSD.org>1996-04-05 16:25:38 +0000
commitc6337b7b469ce85996918431f054b19379dcbca1 (patch)
tree53a9bdf8517ee5f4dab4b53d57d3618329956e2a /sbin/adjkerntz/adjkerntz.c
parent9cb8a1050f9ab97b77ba7bb8650fe5d0a13e0f3e (diff)
downloadsrc-c6337b7b469ce85996918431f054b19379dcbca1.tar.gz
src-c6337b7b469ce85996918431f054b19379dcbca1.zip
Dynamically sense /etc/wall_cmos_clock presence/absense
Notes
Notes: svn path=/head/; revision=15052
Diffstat (limited to 'sbin/adjkerntz/adjkerntz.c')
-rw-r--r--sbin/adjkerntz/adjkerntz.c28
1 files changed, 8 insertions, 20 deletions
diff --git a/sbin/adjkerntz/adjkerntz.c b/sbin/adjkerntz/adjkerntz.c
index 68dbb558aa61..4cc109844416 100644
--- a/sbin/adjkerntz/adjkerntz.c
+++ b/sbin/adjkerntz/adjkerntz.c
@@ -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 @@ again:
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 @@ recalculate:
}
}
- 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) {