aboutsummaryrefslogtreecommitdiff
path: root/sys/kern
diff options
context:
space:
mode:
Diffstat (limited to 'sys/kern')
-rw-r--r--sys/kern/subr_clock.c6
-rw-r--r--sys/kern/subr_rtc.c8
2 files changed, 5 insertions, 9 deletions
diff --git a/sys/kern/subr_clock.c b/sys/kern/subr_clock.c
index 7586402124ec..fe6adf9d79ba 100644
--- a/sys/kern/subr_clock.c
+++ b/sys/kern/subr_clock.c
@@ -49,9 +49,9 @@ __FBSDID("$FreeBSD$");
#include <sys/sysctl.h>
#include <sys/timetc.h>
-int adjkerntz; /* local offset from GMT in seconds */
-int disable_rtc_set; /* disable resettodr() if != 0 */
-int wall_cmos_clock; /* wall CMOS clock assumed if != 0 */
+static int adjkerntz; /* local offset from GMT in seconds */
+static int wall_cmos_clock; /* wall CMOS clock assumed if != 0 */
+int disable_rtc_set; /* disable resettodr() if != 0 */
int tz_minuteswest;
int tz_dsttime;
diff --git a/sys/kern/subr_rtc.c b/sys/kern/subr_rtc.c
index ba1d7194bf29..df0df32d6023 100644
--- a/sys/kern/subr_rtc.c
+++ b/sys/kern/subr_rtc.c
@@ -58,9 +58,6 @@ __FBSDID("$FreeBSD$");
#include <sys/sysctl.h>
#include <sys/timetc.h>
-/* XXX: for the CPU_* sysctl OID constants. */
-#include <machine/cpu.h>
-
#include "clock_if.h"
static device_t clock_dev = NULL;
@@ -132,8 +129,7 @@ inittodr(time_t base)
printf("Check and reset the date immediately!\n");
}
- ts.tv_sec += tz_minuteswest * 60 +
- (wall_cmos_clock ? adjkerntz : 0);
+ ts.tv_sec += utc_offset();
if (timespeccmp(&ref, &ts, >)) {
diff = ref;
@@ -161,7 +157,7 @@ resettodr()
return;
getnanotime(&ts);
- ts.tv_sec -= tz_minuteswest * 60 + (wall_cmos_clock ? adjkerntz : 0);
+ ts.tv_sec -= utc_offset();
if ((error = CLOCK_SETTIME(clock_dev, &ts)) != 0) {
printf("warning: clock_settime failed (%d), time-of-day clock "
"not adjusted to system time\n", error);