summaryrefslogtreecommitdiff
path: root/usr.sbin/ntpd/ntp.c
diff options
context:
space:
mode:
authorHenning Brauer <henning@cvs.openbsd.org>2006-05-27 18:32:01 +0000
committerHenning Brauer <henning@cvs.openbsd.org>2006-05-27 18:32:01 +0000
commit560ca4733ed4d59254c35ab5320b725ee4cc3ff7 (patch)
treecadfe90177d88d9a5c6fa0420bbe5ccfa3e11b3a /usr.sbin/ntpd/ntp.c
parent64201864bbe5387e655daaab298b9c47bd529f61 (diff)
scan for new timedelta sensors every five minutes for now, ok deraadt
Diffstat (limited to 'usr.sbin/ntpd/ntp.c')
-rw-r--r--usr.sbin/ntpd/ntp.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/usr.sbin/ntpd/ntp.c b/usr.sbin/ntpd/ntp.c
index 3fdeb0dcc7c..ae7418d0261 100644
--- a/usr.sbin/ntpd/ntp.c
+++ b/usr.sbin/ntpd/ntp.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ntp.c,v 1.71 2006/05/26 00:33:16 henning Exp $ */
+/* $OpenBSD: ntp.c,v 1.72 2006/05/27 18:32:00 henning Exp $ */
/*
* Copyright (c) 2003, 2004 Henning Brauer <henning@openbsd.org>
@@ -76,7 +76,7 @@ ntp_main(int pipe_prnt[2], struct ntpd_conf *nconf)
struct ntp_sensor *s, *next_s;
struct timespec tp;
struct stat stb;
- time_t nextaction;
+ time_t nextaction, last_sensor_scan = 0;
void *newp;
switch (pid = fork()) {
@@ -149,7 +149,6 @@ ntp_main(int pipe_prnt[2], struct ntpd_conf *nconf)
conf->scale = 1;
sensor_init(conf);
- sensor_scan(conf);
log_info("ntp engine ready");
@@ -232,6 +231,10 @@ ntp_main(int pipe_prnt[2], struct ntpd_conf *nconf)
}
}
+ if (last_sensor_scan + SENSOR_SCAN_INTERVAL < time(NULL)) {
+ sensor_scan(conf);
+ last_sensor_scan = time(NULL);
+ }
sensors_cnt = 0;
TAILQ_FOREACH(s, &conf->ntp_sensors, entry) {
sensors_cnt++;