From 0cb81b54882892aa90eca3064e51e7adf8952287 Mon Sep 17 00:00:00 2001 From: henning <> Date: Wed, 20 Dec 2006 16:50:13 +0000 Subject: [PATCH] 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 --- src/usr.sbin/ntpd/ntp.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/usr.sbin/ntpd/ntp.c b/src/usr.sbin/ntpd/ntp.c index 7a2c307b..62baf61b 100644 --- a/src/usr.sbin/ntpd/ntp.c +++ b/src/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 @@ -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(); }