summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorderaadt <deraadt@openbsd.org>2015-05-25 14:58:34 +0000
committerderaadt <deraadt@openbsd.org>2015-05-25 14:58:34 +0000
commitb5ec6406f25035a69b5dd6c20cc1b616c4773cf0 (patch)
treeac42b6cc9b3866b0b47f261711e552972c9c5375
parentPort the ELF m88k work to binutils 2.17. Good enough to build a booting (diff)
downloadwireguard-openbsd-b5ec6406f25035a69b5dd6c20cc1b616c4773cf0.tar.xz
wireguard-openbsd-b5ec6406f25035a69b5dd6c20cc1b616c4773cf0.zip
only scan sensors if they are configured
ok bcook
Diffstat (limited to '')
-rw-r--r--usr.sbin/ntpd/ntp.c34
1 files changed, 18 insertions, 16 deletions
diff --git a/usr.sbin/ntpd/ntp.c b/usr.sbin/ntpd/ntp.c
index 72f6c96be1e..892509ca1d2 100644
--- a/usr.sbin/ntpd/ntp.c
+++ b/usr.sbin/ntpd/ntp.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ntp.c,v 1.131 2015/05/20 13:32:39 reyk Exp $ */
+/* $OpenBSD: ntp.c,v 1.132 2015/05/25 14:58:34 deraadt Exp $ */
/*
* Copyright (c) 2003, 2004 Henning Brauer <henning@openbsd.org>
@@ -313,21 +313,23 @@ ntp_main(int pipe_prnt[2], int fd_ctl, struct ntpd_conf *nconf,
}
idx_clients = i;
- if (last_sensor_scan == 0 ||
- last_sensor_scan + SENSOR_SCAN_INTERVAL < getmonotime()) {
- sensors_cnt = sensor_scan();
- last_sensor_scan = getmonotime();
- }
- if (!TAILQ_EMPTY(&conf->ntp_conf_sensors) && sensors_cnt == 0 &&
- nextaction > last_sensor_scan + SENSOR_SCAN_INTERVAL)
- nextaction = last_sensor_scan + SENSOR_SCAN_INTERVAL;
- sensors_cnt = 0;
- TAILQ_FOREACH(s, &conf->ntp_sensors, entry) {
- if (conf->settime && s->offsets[0].offset)
- priv_settime(s->offsets[0].offset);
- sensors_cnt++;
- if (s->next > 0 && s->next < nextaction)
- nextaction = s->next;
+ if (!TAILQ_EMPTY(&conf->ntp_conf_sensors)) {
+ if (last_sensor_scan == 0 ||
+ last_sensor_scan + SENSOR_SCAN_INTERVAL < getmonotime()) {
+ sensors_cnt = sensor_scan();
+ last_sensor_scan = getmonotime();
+ }
+ if (sensors_cnt == 0 &&
+ nextaction > last_sensor_scan + SENSOR_SCAN_INTERVAL)
+ nextaction = last_sensor_scan + SENSOR_SCAN_INTERVAL;
+ sensors_cnt = 0;
+ TAILQ_FOREACH(s, &conf->ntp_sensors, entry) {
+ if (conf->settime && s->offsets[0].offset)
+ priv_settime(s->offsets[0].offset);
+ sensors_cnt++;
+ if (s->next > 0 && s->next < nextaction)
+ nextaction = s->next;
+ }
}
if (conf->settime &&