summaryrefslogtreecommitdiff
path: root/sys/arch
diff options
context:
space:
mode:
authorMark Kettenis <kettenis@cvs.openbsd.org>2020-05-02 10:44:50 +0000
committerMark Kettenis <kettenis@cvs.openbsd.org>2020-05-02 10:44:50 +0000
commit88ad19578b247aee6c157233f0d879242a34eaf3 (patch)
tree8f2dc14ca28b3d2708f767696e25ee210e0627fe /sys/arch
parent15874a26b83d86ec7e03b2258514b8206ba377eb (diff)
Fix buglet in previous commit; use time from the struct timeval that was
passed in when setting the RTC time instead of the global time_second. ok mpi@
Diffstat (limited to 'sys/arch')
-rw-r--r--sys/arch/amd64/isa/clock.c4
-rw-r--r--sys/arch/i386/isa/clock.c4
2 files changed, 4 insertions, 4 deletions
diff --git a/sys/arch/amd64/isa/clock.c b/sys/arch/amd64/isa/clock.c
index a93b1a160f0..613f7ee0e0f 100644
--- a/sys/arch/amd64/isa/clock.c
+++ b/sys/arch/amd64/isa/clock.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: clock.c,v 1.32 2020/04/28 12:58:28 kettenis Exp $ */
+/* $OpenBSD: clock.c,v 1.33 2020/05/02 10:44:48 kettenis Exp $ */
/* $NetBSD: clock.c,v 1.1 2003/04/26 18:39:50 fvdl Exp $ */
/*-
@@ -464,7 +464,7 @@ rtcsettime(struct todr_chip_handle *handle, struct timeval *tv)
memset(&rtclk, 0, sizeof(rtclk));
splx(s);
- clock_secs_to_ymdhms(time_second + utc_offset, &dt);
+ clock_secs_to_ymdhms(tv->tv_sec + utc_offset, &dt);
rtclk[MC_SEC] = bintobcd(dt.dt_sec);
rtclk[MC_MIN] = bintobcd(dt.dt_min);
diff --git a/sys/arch/i386/isa/clock.c b/sys/arch/i386/isa/clock.c
index 836ac088662..09a6db983f2 100644
--- a/sys/arch/i386/isa/clock.c
+++ b/sys/arch/i386/isa/clock.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: clock.c,v 1.57 2020/04/29 08:53:45 kettenis Exp $ */
+/* $OpenBSD: clock.c,v 1.58 2020/05/02 10:44:49 kettenis Exp $ */
/* $NetBSD: clock.c,v 1.39 1996/05/12 23:11:54 mycroft Exp $ */
/*-
@@ -614,7 +614,7 @@ rtcsettime(struct todr_chip_handle *handle, struct timeval *tv)
memset(&rtclk, 0, sizeof(rtclk));
splx(s);
- clock_secs_to_ymdhms(time_second + utc_offset, &dt);
+ clock_secs_to_ymdhms(tv->tv_sec + utc_offset, &dt);
rtclk[MC_SEC] = bintobcd(dt.dt_sec);
rtclk[MC_MIN] = bintobcd(dt.dt_min);