diff --git a/src/usr.sbin/ntpd/ntp.c b/src/usr.sbin/ntpd/ntp.c index 0fceeb90..7592c210 100644 --- a/src/usr.sbin/ntpd/ntp.c +++ b/src/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 @@ -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/src/usr.sbin/ntpd/sensors.c b/src/usr.sbin/ntpd/sensors.c index 7e7baf18..32b8607a 100644 --- a/src/usr.sbin/ntpd/sensors.c +++ b/src/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 @@ -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);