diff options
author | Henning Brauer <henning@cvs.openbsd.org> | 2006-12-20 16:50:14 +0000 |
---|---|---|
committer | Henning Brauer <henning@cvs.openbsd.org> | 2006-12-20 16:50:14 +0000 |
commit | f1d66a4306798ec857ad72d1921a81f3ecfebd07 (patch) | |
tree | 83301d446df12ec2446961ccfa4744c060e94a6f /usr.sbin/ntpd/ntp.c | |
parent | ba2965b1fe0d0dcfa1c82f33254b25abdd0717cf (diff) |
let ntpd use sensors immediately after system boot by special casing
last_sensor_scan == 0. monotime might be very close to 0 after boot.
source unknown, maybe from naddy, rediscovered & ok mblamer
Diffstat (limited to 'usr.sbin/ntpd/ntp.c')
-rw-r--r-- | usr.sbin/ntpd/ntp.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/usr.sbin/ntpd/ntp.c b/usr.sbin/ntpd/ntp.c index 7a2c307bb7c..62baf61b68c 100644 --- a/usr.sbin/ntpd/ntp.c +++ b/usr.sbin/ntpd/ntp.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ntp.c,v 1.95 2006/11/30 18:42:41 ckuethe Exp $ */ +/* $OpenBSD: ntp.c,v 1.96 2006/12/20 16:50:13 henning Exp $ */ /* * Copyright (c) 2003, 2004 Henning Brauer <henning@openbsd.org> @@ -251,7 +251,8 @@ ntp_main(int pipe_prnt[2], struct ntpd_conf *nconf) } } - if (last_sensor_scan + SENSOR_SCAN_INTERVAL < getmonotime()) { + if (last_sensor_scan == 0 || + last_sensor_scan + SENSOR_SCAN_INTERVAL < getmonotime()) { sensor_scan(); last_sensor_scan = getmonotime(); } |