Module Name: src Committed By: jmmv Date: Mon Jan 17 22:21:25 UTC 2011
Modified Files: src/sys/arch/x86/x86: platform.c Log Message: Fix year correction in platform_add_date so that: * Years in the [90,99] range are considered to be in 1900. * Years in the [0,89] range are considered to be in 2000. This makes my MacBookPro2,2 be recognized as from 2007 instead of 1907, which in turn lets ACPI (and many other things!) work. Fix proposed by jmcneill@ as an alternative to my workaround in acpi_quirks.c sent to port-i386@. To generate a diff of this commit: cvs rdiff -u -r1.9 -r1.10 src/sys/arch/x86/x86/platform.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Modified files: Index: src/sys/arch/x86/x86/platform.c diff -u src/sys/arch/x86/x86/platform.c:1.9 src/sys/arch/x86/x86/platform.c:1.10 --- src/sys/arch/x86/x86/platform.c:1.9 Mon Sep 6 15:54:27 2010 +++ src/sys/arch/x86/x86/platform.c Mon Jan 17 22:21:25 2011 @@ -1,4 +1,4 @@ -/* $NetBSD: platform.c,v 1.9 2010/09/06 15:54:27 jmcneill Exp $ */ +/* $NetBSD: platform.c,v 1.10 2011/01/17 22:21:25 jmmv Exp $ */ /*- * Copyright (c) 2007 Jared D. McNeill <jmcne...@invisible.ca> @@ -29,7 +29,7 @@ #include "isa.h" #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: platform.c,v 1.9 2010/09/06 15:54:27 jmcneill Exp $"); +__KERNEL_RCSID(0, "$NetBSD: platform.c,v 1.10 2011/01/17 22:21:25 jmmv Exp $"); #include <sys/types.h> #include <sys/param.h> @@ -165,10 +165,12 @@ return; if (month == 0 || month > 12 || day == 0 || day > 31) return; - if (year < 100) - year += 1900; if (year > 9999) return; + if (year < 90) + year += 2000; + else if (year < 100) + year += 1900; sprintf(datestr, "%04u%02u%02u", year, month, day); pmf_set_platform(key, datestr); }