diff options
author | Henning Brauer <henning@cvs.openbsd.org> | 2006-05-27 22:22:48 +0000 |
---|---|---|
committer | Henning Brauer <henning@cvs.openbsd.org> | 2006-05-27 22:22:48 +0000 |
commit | ab1b2afa516f90c0314b01f2b3a6898eb9bcfd72 (patch) | |
tree | 9e2a1ee781fbd8dd85c676738cdbdb7bbc782142 /usr.sbin/ntpd/sensors.c | |
parent | 106ee2c6eb16e1e33a4d103a2ec8e3d2c86e174d (diff) |
stop passing the config around all time, just store one copy
Diffstat (limited to 'usr.sbin/ntpd/sensors.c')
-rw-r--r-- | usr.sbin/ntpd/sensors.c | 23 |
1 files changed, 13 insertions, 10 deletions
diff --git a/usr.sbin/ntpd/sensors.c b/usr.sbin/ntpd/sensors.c index d493b4476eb..ea8de0f8c8c 100644 --- a/usr.sbin/ntpd/sensors.c +++ b/usr.sbin/ntpd/sensors.c @@ -1,4 +1,4 @@ -/* $OpenBSD: sensors.c,v 1.4 2006/05/27 21:33:47 henning Exp $ */ +/* $OpenBSD: sensors.c,v 1.5 2006/05/27 22:22:47 henning Exp $ */ /* * Copyright (c) 2006 Henning Brauer <henning@openbsd.org> @@ -34,26 +34,29 @@ #define SENSORS_MAX 255 #define _PATH_DEV_HOTPLUG "/dev/hotplug" -void sensor_probe(struct ntpd_conf *, int); -void sensor_add(struct ntpd_conf *, struct sensor *); +void sensor_probe(int); +void sensor_add(struct sensor *); + +struct ntpd_conf *conf; void -sensor_init(struct ntpd_conf *conf) +sensor_init(struct ntpd_conf *c) { + conf = c; TAILQ_INIT(&conf->ntp_sensors); } void -sensor_scan(struct ntpd_conf *conf) +sensor_scan(void) { int i; for (i = 0; i < SENSORS_MAX; i++) - sensor_probe(conf, i); + sensor_probe(i); } void -sensor_probe(struct ntpd_conf *conf, int id) +sensor_probe(int id) { int mib[3]; size_t len; @@ -71,11 +74,11 @@ sensor_probe(struct ntpd_conf *conf, int id) } if (sensor.type == SENSOR_TIMEDELTA) - sensor_add(conf, &sensor); + sensor_add(&sensor); } void -sensor_add(struct ntpd_conf *conf, struct sensor *sensor) +sensor_add(struct sensor *sensor) { struct ntp_sensor *s; struct ntp_conf_sensor *cs; @@ -107,7 +110,7 @@ sensor_add(struct ntpd_conf *conf, struct sensor *sensor) } void -sensor_remove(struct ntpd_conf *conf, struct ntp_sensor *s) +sensor_remove(struct ntp_sensor *s) { TAILQ_REMOVE(&conf->ntp_sensors, s, entry); free(s->device); |