diff options
author | Mark Kettenis <kettenis@cvs.openbsd.org> | 2020-05-02 10:44:50 +0000 |
---|---|---|
committer | Mark Kettenis <kettenis@cvs.openbsd.org> | 2020-05-02 10:44:50 +0000 |
commit | 88ad19578b247aee6c157233f0d879242a34eaf3 (patch) | |
tree | 8f2dc14ca28b3d2708f767696e25ee210e0627fe /sys/arch | |
parent | 15874a26b83d86ec7e03b2258514b8206ba377eb (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.c | 4 | ||||
-rw-r--r-- | sys/arch/i386/isa/clock.c | 4 |
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); |