summaryrefslogtreecommitdiff
path: root/sys/arch/amiga/dev/a2kbbc.c
diff options
context:
space:
mode:
authorMarc Espie <espie@cvs.openbsd.org>2000-01-24 16:02:05 +0000
committerMarc Espie <espie@cvs.openbsd.org>2000-01-24 16:02:05 +0000
commit0bc9a23a8da2ec668b97493c68a333c6e9f04c26 (patch)
treeeaa06ed76b563fc9dcd7175878caa07b7fe5e1c4 /sys/arch/amiga/dev/a2kbbc.c
parent6cac601084a8fff27c3019d896171c0e1dc0f940 (diff)
Amiga HW clock code was not Y2K compliant.
Fix (from netbsd).
Diffstat (limited to 'sys/arch/amiga/dev/a2kbbc.c')
-rw-r--r--sys/arch/amiga/dev/a2kbbc.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/sys/arch/amiga/dev/a2kbbc.c b/sys/arch/amiga/dev/a2kbbc.c
index 16081b80221..a8968db91b5 100644
--- a/sys/arch/amiga/dev/a2kbbc.c
+++ b/sys/arch/amiga/dev/a2kbbc.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: a2kbbc.c,v 1.1 1997/09/18 13:39:41 niklas Exp $ */
+/* $OpenBSD: a2kbbc.c,v 1.2 2000/01/24 16:02:04 espie Exp $ */
/* $NetBSD: a2kbbc.c,v 1.3 1997/07/23 10:19:44 is Exp $ */
/*
@@ -175,6 +175,9 @@ a2gettod()
rt->control1 &= ~A2CONTROL1_HOLD;
dt.dt_year += CLOCK_BASE_YEAR;
+ /* Ancient year: must be >=2000 */
+ if (dt.dt_year < STARTOFTIME)
+ dt.dt_year += 100;
if ((dt.dt_hour > 23) ||
(dt.dt_day > 31) ||
@@ -203,7 +206,6 @@ a2settod(secs)
return (0);
clock_secs_to_ymdhms(secs, &dt);
- dt.dt_year -= CLOCK_BASE_YEAR;
/*
* hold clock
@@ -235,7 +237,8 @@ a2settod(secs)
rt->day2 = dt.dt_day % 10;
rt->month1 = dt.dt_mon / 10;
rt->month2 = dt.dt_mon % 10;
- rt->year1 = dt.dt_year / 10;
+ /* Store two digit year */
+ rt->year1 = (dt.dt_year / 10) % 10;
rt->year2 = dt.dt_year % 10;
rt->weekday = dt.dt_wday;