summaryrefslogtreecommitdiff
path: root/sys/arch/sparc64
diff options
context:
space:
mode:
authorMark Kettenis <kettenis@cvs.openbsd.org>2020-05-11 13:25:33 +0000
committerMark Kettenis <kettenis@cvs.openbsd.org>2020-05-11 13:25:33 +0000
commit9cc9b6c9fc74e84fce54850e733a006d2a3f7fac (patch)
tree964a908fc97ba836fffad4d5f761204b8edec663 /sys/arch/sparc64
parent9399ec50b1f957646361c80b209ee79b3b150b7d (diff)
Initialize the timeval passed to todr_gettime() with the base time from
the file system such that implementations can use it to guess the right century. ok mpi@
Diffstat (limited to 'sys/arch/sparc64')
-rw-r--r--sys/arch/sparc64/sparc64/machdep.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/sys/arch/sparc64/sparc64/machdep.c b/sys/arch/sparc64/sparc64/machdep.c
index b29a6cb3364..2717b237192 100644
--- a/sys/arch/sparc64/sparc64/machdep.c
+++ b/sys/arch/sparc64/sparc64/machdep.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: machdep.c,v 1.192 2020/04/28 12:24:20 kettenis Exp $ */
+/* $OpenBSD: machdep.c,v 1.193 2020/05/11 13:25:32 kettenis Exp $ */
/* $NetBSD: machdep.c,v 1.108 2001/07/24 19:30:14 eeh Exp $ */
/*-
@@ -2144,6 +2144,9 @@ inittodr(time_t base)
} else
badbase = 0;
+ rtctime.tv_sec = base;
+ rtctime.tv_usec = 0;
+
if (todr_handle == NULL ||
todr_gettime(todr_handle, &rtctime) != 0 ||
rtctime.tv_sec < (MINYEAR - 1970) * SECYR) {