diff --git a/sys/kern/kern_todr.c b/sys/kern/kern_todr.c index 01e1f266fb6d..342f4569fd29 100644 --- a/sys/kern/kern_todr.c +++ b/sys/kern/kern_todr.c @@ -1,4 +1,4 @@ -/* $NetBSD: kern_todr.c,v 1.4 2006/09/03 17:13:04 gdamore Exp $ */ +/* $NetBSD: kern_todr.c,v 1.5 2006/09/05 19:32:17 matt Exp $ */ /* * Copyright (c) 1992, 1993 @@ -76,7 +76,7 @@ * @(#)clock.c 8.1 (Berkeley) 6/10/93 */ #include -__KERNEL_RCSID(0, "$NetBSD: kern_todr.c,v 1.4 2006/09/03 17:13:04 gdamore Exp $"); +__KERNEL_RCSID(0, "$NetBSD: kern_todr.c,v 1.5 2006/09/05 19:32:17 matt Exp $"); #include @@ -112,7 +112,7 @@ static int timeset = 0; void inittodr(time_t base) { - int badbase = 0, waszero = base == 0, goodtime = 0, badrtc = 0; + int badbase = 0, waszero = (base == 0), goodtime = 0, badrtc = 0; #ifdef __HAVE_TIMECOUNTER struct timespec ts; #endif @@ -138,6 +138,12 @@ inittodr(time_t base) badbase = 1; } + /* + * Some ports need to be supplied base in order to fabricate a time_t. + */ + tv.tv_sec = base; + tv.tv_usec = 0; + if ((todr_handle == NULL) || (todr_gettime(todr_handle, &tv) != 0) || (tv.tv_sec < (5 * SECYR))) { @@ -199,9 +205,7 @@ inittodr(time_t base) if (waszero || goodtime) return; - printf("WARNING: CHECK AND RESET THE DATE!\n"); - } /*