summaryrefslogtreecommitdiff
path: root/usr.sbin/ntpd
diff options
context:
space:
mode:
authorHenning Brauer <henning@cvs.openbsd.org>2006-05-28 03:23:09 +0000
committerHenning Brauer <henning@cvs.openbsd.org>2006-05-28 03:23:09 +0000
commitb4d521c04e348ea5971714635a3a76dcc457f8d3 (patch)
tree596970fd00c4618e7fb438f4f123d75c067d0c43 /usr.sbin/ntpd
parent6d785c83892544f06cd12e7add468a180d15c97d (diff)
DV_SENSORS is no more, plug workaround for the time to the real solution
Diffstat (limited to 'usr.sbin/ntpd')
-rw-r--r--usr.sbin/ntpd/ntp.c9
-rw-r--r--usr.sbin/ntpd/sensors.c8
2 files changed, 8 insertions, 9 deletions
diff --git a/usr.sbin/ntpd/ntp.c b/usr.sbin/ntpd/ntp.c
index 0fceeb90326..7592c210aff 100644
--- a/usr.sbin/ntpd/ntp.c
+++ b/usr.sbin/ntpd/ntp.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ntp.c,v 1.74 2006/05/27 22:22:47 henning Exp $ */
+/* $OpenBSD: ntp.c,v 1.75 2006/05/28 03:23:08 henning Exp $ */
/*
* Copyright (c) 2003, 2004 Henning Brauer <henning@openbsd.org>
@@ -78,7 +78,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, last_sensor_scan = 0;
+ time_t nextaction;
void *newp;
switch (pid = fork()) {
@@ -152,6 +152,7 @@ ntp_main(int pipe_prnt[2], struct ntpd_conf *nconf)
conf->scale = 1;
sensor_init(conf);
+ sensor_scan();
log_info("ntp engine ready");
@@ -236,10 +237,6 @@ ntp_main(int pipe_prnt[2], struct ntpd_conf *nconf)
}
}
- if (last_sensor_scan + SENSOR_SCAN_INTERVAL < time(NULL)) {
- sensor_scan();
- last_sensor_scan = time(NULL);
- }
sensors_cnt = 0;
TAILQ_FOREACH(s, &conf->ntp_sensors, entry) {
sensors_cnt++;
diff --git a/usr.sbin/ntpd/sensors.c b/usr.sbin/ntpd/sensors.c
index 7e7baf1815c..32b8607a0ee 100644
--- a/usr.sbin/ntpd/sensors.c
+++ b/usr.sbin/ntpd/sensors.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: sensors.c,v 1.7 2006/05/28 02:06:46 henning Exp $ */
+/* $OpenBSD: sensors.c,v 1.8 2006/05/28 03:23:08 henning Exp $ */
/*
* Copyright (c) 2006 Henning Brauer <henning@openbsd.org>
@@ -208,11 +208,13 @@ sensor_hotplugevent(int fd)
if (n == sizeof(he))
switch (he.he_type) {
case HOTPLUG_DEVAT:
- if (he.he_devclass == DV_SENSOR)
+ if (he.he_devclass == DV_DULL &&
+ he.he_devid > 0)
sensor_probe(he.he_devid);
break;
case HOTPLUG_DEVDT:
- if (he.he_devclass == DV_SENSOR) {
+ if (he.he_devclass == DV_DULL &&
+ he.he_devid > 0) {
struct ntp_sensor *s;
s = sensor_byid(he.he_devid);