Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/arch/macppc/macppc If the RTC gives a time more than 100...
details: https://anonhg.NetBSD.org/src/rev/463df7a9b0b7
branches: trunk
changeset: 517315:463df7a9b0b7
user: augustss <augustss%NetBSD.org@localhost>
date: Sat Nov 10 15:37:40 2001 +0000
description:
If the RTC gives a time more than 1000 days before file system time then
use the file system time. (My iMac seems to give 1904 as the year very
often (dead battery?), and setting the correct date with ntpdate doesn't
seem to work.)
diffstat:
sys/arch/macppc/macppc/clock.c | 7 +++++--
1 files changed, 5 insertions(+), 2 deletions(-)
diffs (21 lines):
diff -r 8d2993995cc1 -r 463df7a9b0b7 sys/arch/macppc/macppc/clock.c
--- a/sys/arch/macppc/macppc/clock.c Sat Nov 10 14:58:20 2001 +0000
+++ b/sys/arch/macppc/macppc/clock.c Sat Nov 10 15:37:40 2001 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: clock.c,v 1.17 2001/06/08 00:32:03 matt Exp $ */
+/* $NetBSD: clock.c,v 1.18 2001/11/10 15:37:40 augustss Exp $ */
/*
* Copyright (C) 1995, 1996 Wolfgang Solfrank.
@@ -101,7 +101,10 @@
printf("WARNING: clock %s %d days",
time.tv_sec < base ? "lost" : "gained", (int)(deltat / SECDAY));
-
+ if (time.tv_sec < base && deltat > 1000 * SECDAY) {
+ printf(", using FS time");
+ time.tv_sec = base;
+ }
printf(" -- CHECK AND RESET THE DATE!\n");
}
Home |
Main Index |
Thread Index |
Old Index