summaryrefslogtreecommitdiff
path: root/usr.sbin/ntpd/sensors.c
diff options
context:
space:
mode:
authorChris Kuethe <ckuethe@cvs.openbsd.org>2007-08-04 02:58:03 +0000
committerChris Kuethe <ckuethe@cvs.openbsd.org>2007-08-04 02:58:03 +0000
commit72fdd4aa7ffacbc35e9c3a225ae6e1a5afaaf5b7 (patch)
tree5fcfab81b2a125cc704fc8c282a3853bc1a3ecc8 /usr.sbin/ntpd/sensors.c
parentbd112afb5eed44be20dca2e88ed36a6395c26116 (diff)
This diff makes ntpd poll for sensors more aggressively when the use of
sensors is requested, but no sensors are found. ok henning
Diffstat (limited to 'usr.sbin/ntpd/sensors.c')
-rw-r--r--usr.sbin/ntpd/sensors.c13
1 files changed, 9 insertions, 4 deletions
diff --git a/usr.sbin/ntpd/sensors.c b/usr.sbin/ntpd/sensors.c
index 3df6cbdb494..dde110f8f72 100644
--- a/usr.sbin/ntpd/sensors.c
+++ b/usr.sbin/ntpd/sensors.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: sensors.c,v 1.32 2007/01/23 17:44:38 claudio Exp $ */
+/* $OpenBSD: sensors.c,v 1.33 2007/08/04 02:58:02 ckuethe Exp $ */
/*
* Copyright (c) 2006 Henning Brauer <henning@openbsd.org>
@@ -45,16 +45,21 @@ sensor_init(void)
TAILQ_INIT(&conf->ntp_sensors);
}
-void
+int
sensor_scan(void)
{
- int i;
+ int i, n;
char d[MAXDEVNAMLEN];
struct sensor s;
+ n = 0;
for (i = 0; i < MAXSENSORDEVICES; i++)
- if (sensor_probe(i, d, &s))
+ if (sensor_probe(i, d, &s)) {
sensor_add(i, d);
+ n++;
+ }
+
+ return n;
}
int