Fix the boottime calculation when the time of day is set in absolute terms.
authorMatthew Dillon <dillon@dragonflybsd.org>
Sat, 4 Dec 2004 20:38:45 +0000 (20:38 +0000)
committerMatthew Dillon <dillon@dragonflybsd.org>
Sat, 4 Dec 2004 20:38:45 +0000 (20:38 +0000)
commita81931cc8f67b284993e55aa842b2e982bcba4b2
treedaf691a59338072762de0b77743e7fbf076afb46
parentdf9d7670a0278eb9d03082fd7331af32350cf87b
Fix the boottime calculation when the time of day is set in absolute terms.
We want boottime to be calculated based on the current real time minus our
best uptime guess.  gd_time_seconds survives a lot of time issues and is our
best uptime guess and since it is already used to calculate the new basetime,
we can just assign boottime to basetime.

Note that boottime is not defined quite the same way as basetime.  The
system's internal timebase is not compensated for drift or ever jumped,
and is guarenteed to be monotonically increasing.  Drift compensation is
accomplished by adjusting basetime, so basetime will always slowly diverge
from boottime if e.g. ntpd is running.

Submitted-by: Paul Herman <pherman@frenchfries.net>
sys/kern/kern_clock.c