Browse Source

DV_SENSORS is no more, plug workaround for the time to the real solution

OPENBSD_4_0
henning 18 years ago
parent
commit
d5fece7cde
2 changed files with 8 additions and 9 deletions
  1. +3
    -6
      src/usr.sbin/ntpd/ntp.c
  2. +5
    -3
      src/usr.sbin/ntpd/sensors.c

+ 3
- 6
src/usr.sbin/ntpd/ntp.c View File

@ -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++;


+ 5
- 3
src/usr.sbin/ntpd/sensors.c View File

@ -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);


Loading…
Cancel
Save