Subject: NetBSD master CVS tree commits
To: None <source-changes@netbsd.org>
From: The Source of All Evil <source@netbsd.org>
List: source-changes
Date: 08/04/1998 18:30:02
perry
Tue Aug  4 18:21:55 PDT 1998
Update of /cvsroot/src/sys/arch/i386/isa
In directory nb00:/tmp/cvs-serv20329

Modified Files:
	clock.c 
Log Message:
Fix a problem first noticed by a user with a screwed up real time
clock past the End of Time.

If time_t is 32 bits, then the "End of Time" is Jan 18/19 2038
(depending on time zone).

This code copes with RTC's past the end of time if time_t is an int32
or less. It just forces the time back to 2037.  This will let users
with screwed up clocks to at least boot and function long enough to
set their clocks to something sane.

This kludge is conditioned on an 
	if (sizeof(time_t) <= sizeof(int32_t))
which will automatically optimize the code out once we switch time_t
to a 64 bit quantity, which should happen well before 2037.

Patch based on code from Michael C. Richardson, with help from
Allen Briggs who pointed out a fencepost error.