summaryrefslogtreecommitdiffstats
path: root/sys/kern/subr_rtc.c
diff options
context:
space:
mode:
authorphk <phk@FreeBSD.org>2003-02-03 19:49:35 +0000
committerphk <phk@FreeBSD.org>2003-02-03 19:49:35 +0000
commit3692879cc82e12c56c011d2bf97d1c02bd3d66c5 (patch)
tree7251be2a86087b08495da120d84f24f25ed673c8 /sys/kern/subr_rtc.c
parentdb8a973d3ddfc686520b7766d7464f5140726cd9 (diff)
downloadFreeBSD-src-3692879cc82e12c56c011d2bf97d1c02bd3d66c5.zip
FreeBSD-src-3692879cc82e12c56c011d2bf97d1c02bd3d66c5.tar.gz
Split the global timezone structure into two integer fields to
prevent the compiler from optimizing assignments into byte-copy operations which might make access to the individual fields non-atomic. Use the individual fields throughout, and don't bother locking them with Giant: it is no longer needed. Inspired by: tjr
Diffstat (limited to 'sys/kern/subr_rtc.c')
-rw-r--r--sys/kern/subr_rtc.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/sys/kern/subr_rtc.c b/sys/kern/subr_rtc.c
index e573463..19df90d 100644
--- a/sys/kern/subr_rtc.c
+++ b/sys/kern/subr_rtc.c
@@ -281,7 +281,7 @@ inittodr(time_t base)
printf("Check and reset the date immediately!\n");
}
- ts.tv_sec += tz.tz_minuteswest * 60 +
+ ts.tv_sec += tz_minuteswest * 60 +
(wall_cmos_clock ? adjkerntz : 0);
if (timespeccmp(&ref, &ts, >)) {
@@ -310,7 +310,7 @@ resettodr()
return;
getnanotime(&ts);
- ts.tv_sec -= tz.tz_minuteswest * 60 + (wall_cmos_clock ? adjkerntz : 0);
+ ts.tv_sec -= tz_minuteswest * 60 + (wall_cmos_clock ? adjkerntz : 0);
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);
OpenPOWER on IntegriCloud