summaryrefslogtreecommitdiff
path: root/sys/arch/sparc64
diff options
context:
space:
mode:
Diffstat (limited to 'sys/arch/sparc64')
-rw-r--r--sys/arch/sparc64/sparc64/clock.c17
1 files changed, 12 insertions, 5 deletions
diff --git a/sys/arch/sparc64/sparc64/clock.c b/sys/arch/sparc64/sparc64/clock.c
index 9ba4fe2f29b..e6af667f323 100644
--- a/sys/arch/sparc64/sparc64/clock.c
+++ b/sys/arch/sparc64/sparc64/clock.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: clock.c,v 1.18 2003/05/18 15:32:10 henric Exp $ */
+/* $OpenBSD: clock.c,v 1.19 2004/04/08 01:11:22 deraadt Exp $ */
/* $NetBSD: clock.c,v 1.41 2001/07/24 19:29:25 eeh Exp $ */
/*
@@ -895,6 +895,7 @@ inittodr(base)
time_t base;
{
int badbase = 0, waszero = base == 0;
+ char *bad = NULL;
if (base < 5 * SECYR) {
/*
@@ -909,13 +910,13 @@ inittodr(base)
}
if (todr_handle &&
- (todr_gettime(todr_handle, (struct timeval *)&time) != 0 ||
- time.tv_sec == 0)) {
- printf("WARNING: bad date in battery clock");
+ (todr_gettime(todr_handle, (struct timeval *)&time) != 0 ||
+ time.tv_sec == 0)) {
/*
* Believe the time in the file system for lack of
* anything better, resetting the clock.
*/
+ bad = "WARNING: bad date in battery clock";
time.tv_sec = base;
if (!badbase)
resettodr();
@@ -928,10 +929,16 @@ inittodr(base)
deltat = -deltat;
if (waszero || deltat < 2 * SECDAY)
return;
+#ifndef SMALL_KERNEL
printf("WARNING: clock %s %ld days",
time.tv_sec < base ? "lost" : "gained", deltat / SECDAY);
+ bad = "";
+#endif
+ }
+ if (bad) {
+ printf("%s", bad);
+ printf(" -- CHECK AND RESET THE DATE!\n");
}
- printf(" -- CHECK AND RESET THE DATE!\n");
}
/*