Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/netbsd-1-4]: src/sys/arch/atari/dev Pull up revision 1.21 (requested by ...



details:   https://anonhg.NetBSD.org/src/rev/51a861d59d38
branches:  netbsd-1-4
changeset: 470139:51a861d59d38
user:      he <he%NetBSD.org@localhost>
date:      Fri Jan 21 00:27:47 2000 +0000

description:
Pull up revision 1.21 (requested by leo):
  Fix Y2K buglet in /dev/rtc.  Note that the input and output format
  of that device has now changed.

diffstat:

 sys/arch/atari/dev/clock.c |  21 ++++++++++-----------
 1 files changed, 10 insertions(+), 11 deletions(-)

diffs (49 lines):

diff -r f5418ce7b207 -r 51a861d59d38 sys/arch/atari/dev/clock.c
--- a/sys/arch/atari/dev/clock.c        Fri Jan 21 00:20:45 2000 +0000
+++ b/sys/arch/atari/dev/clock.c        Fri Jan 21 00:27:47 2000 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: clock.c,v 1.19.8.1 1999/12/16 22:22:53 he Exp $        */
+/*     $NetBSD: clock.c,v 1.19.8.2 2000/01/21 00:27:47 he Exp $        */
 
 /*
  * Copyright (c) 1988 University of Utah.
@@ -491,8 +491,8 @@
        MC146818_GETTOD(RTC, &clkregs);
        splx(s);
 
-       sprintf(buffer, "%02d%02d%02d%02d%02d.%02d\n",
-           clkregs[MC_YEAR] + GEMSTARTOFTIME - 1900,
+       sprintf(buffer, "%4d%02d%02d%02d%02d.%02d\n",
+           clkregs[MC_YEAR] + GEMSTARTOFTIME,
            clkregs[MC_MONTH], clkregs[MC_DOM],
            clkregs[MC_HOUR], clkregs[MC_MIN], clkregs[MC_SEC]);
 
@@ -528,7 +528,7 @@
 {
        mc_todregs              clkregs;
        int                     s, length, error;
-       char                    buffer[14];
+       char                    buffer[16];
 
        /*
         * We require atomic updates!
@@ -548,13 +548,12 @@
        MC146818_GETTOD(RTC, &clkregs);
        splx(s);
 
-       clkregs[MC_SEC]   = twodigits(buffer, 11);
-       clkregs[MC_MIN]   = twodigits(buffer, 8);
-       clkregs[MC_HOUR]  = twodigits(buffer, 6);
-       clkregs[MC_DOM]   = twodigits(buffer, 4);
-       clkregs[MC_MONTH] = twodigits(buffer, 2);
-       s = twodigits(buffer, 0);
-       s = (s < 70) ? s + 2000 : s + 1900;
+       clkregs[MC_SEC]   = twodigits(buffer, 13);
+       clkregs[MC_MIN]   = twodigits(buffer, 10);
+       clkregs[MC_HOUR]  = twodigits(buffer, 8);
+       clkregs[MC_DOM]   = twodigits(buffer, 6);
+       clkregs[MC_MONTH] = twodigits(buffer, 4);
+       s = twodigits(buffer, 0) * 100 + twodigits(buffer, 2);
        clkregs[MC_YEAR]  = s - GEMSTARTOFTIME; 
 
        s = splclock();



Home | Main Index | Thread Index | Old Index