Date: Mon, 13 Jul 2015 11:59:29 +0000 (UTC) From: Christian Brueffer <brueffer@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r285447 - stable/9/sys/x86/isa Message-ID: <201507131159.t6DBxTf6075218@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: brueffer Date: Mon Jul 13 11:59:28 2015 New Revision: 285447 URL: https://svnweb.freebsd.org/changeset/base/285447 Log: 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 Modified: stable/9/sys/x86/isa/atrtc.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/x86/isa/atrtc.c ============================================================================== --- stable/9/sys/x86/isa/atrtc.c Mon Jul 13 11:58:08 2015 (r285446) +++ stable/9/sys/x86/isa/atrtc.c Mon Jul 13 11:59:28 2015 (r285447) @@ -354,7 +354,7 @@ atrtc_gettime(device_t dev, struct times #ifdef USE_RTC_CENTURY ct.year += readrtc(RTC_CENTURY) * 100; #else - ct.year += 2000; + ct.year += (ct.year < 80 ? 2000 : 1900); #endif /* Set dow = -1 because some clocks don't set it correctly. */ ct.dow = -1;
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201507131159.t6DBxTf6075218>