From owner-svn-src-stable-10@freebsd.org Mon Jul 13 11:58:10 2015 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8EACA99BAF2; Mon, 13 Jul 2015 11:58:10 +0000 (UTC) (envelope-from brueffer@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 60CCAC4B; Mon, 13 Jul 2015 11:58:10 +0000 (UTC) (envelope-from brueffer@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.14.9/8.14.9) with ESMTP id t6DBw9V3074924; Mon, 13 Jul 2015 11:58:09 GMT (envelope-from brueffer@FreeBSD.org) Received: (from brueffer@localhost) by repo.freebsd.org (8.14.9/8.14.9/Submit) id t6DBw9vR074923; Mon, 13 Jul 2015 11:58:09 GMT (envelope-from brueffer@FreeBSD.org) Message-Id: <201507131158.t6DBw9vR074923@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: brueffer set sender to brueffer@FreeBSD.org using -f From: Christian Brueffer Date: Mon, 13 Jul 2015 11:58:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r285446 - stable/10/sys/x86/isa X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 13 Jul 2015 11:58:10 -0000 Author: brueffer Date: Mon Jul 13 11:58:08 2015 New Revision: 285446 URL: https://svnweb.freebsd.org/changeset/base/285446 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 Approved by: re (gjb) Modified: stable/10/sys/x86/isa/atrtc.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/x86/isa/atrtc.c ============================================================================== --- stable/10/sys/x86/isa/atrtc.c Mon Jul 13 10:23:52 2015 (r285445) +++ stable/10/sys/x86/isa/atrtc.c Mon Jul 13 11:58:08 2015 (r285446) @@ -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 critical_exit(); /* Set dow = -1 because some clocks don't set it correctly. */