From c846b28e604ba83a68fe804104922daa0d814113 Mon Sep 17 00:00:00 2001 From: brueffer Date: Mon, 13 Jul 2015 11:58:08 +0000 Subject: MFC: r284931 Set the initial system time to a sane (as in: not end of 21st century) value when booting on a PC with CMOS clock set to a year before 2000. This uses 1980 (instead of 1970 as in the initial patch) as pivot year as suggested by imp in the PR followup. PR: 195703 Submitted by: cs@soi.spb.ru Reviewed by: imp Approved by: re (gjb) --- sys/x86/isa/atrtc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/x86/isa/atrtc.c b/sys/x86/isa/atrtc.c index 69c2157..d969594 100644 --- a/sys/x86/isa/atrtc.c +++ b/sys/x86/isa/atrtc.c @@ -354,7 +354,7 @@ atrtc_gettime(device_t dev, struct timespec *ts) #ifdef USE_RTC_CENTURY ct.year += readrtc(RTC_CENTURY) * 100; #else - ct.year += 2000; + ct.year += (ct.year < 80 ? 2000 : 1900); #endif critical_exit(); /* Set dow = -1 because some clocks don't set it correctly. */ -- cgit v1.1