summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHenning Brauer <henning@cvs.openbsd.org>2006-05-28 02:06:47 +0000
committerHenning Brauer <henning@cvs.openbsd.org>2006-05-28 02:06:47 +0000
commitbf60f7621e9c87ef370304f34d38d43fa35150e0 (patch)
treecdf13bd258e183d723893273d3d7f0e6a52dee18
parent1c0c7dd860780ae17bd8ea82bff30b6c35a586e0 (diff)
make use of the new hotplug events for sensors showing up or vanishing
-rw-r--r--usr.sbin/ntpd/sensors.c15
1 files changed, 14 insertions, 1 deletions
diff --git a/usr.sbin/ntpd/sensors.c b/usr.sbin/ntpd/sensors.c
index 98c52c39b81..7e7baf1815c 100644
--- a/usr.sbin/ntpd/sensors.c
+++ b/usr.sbin/ntpd/sensors.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: sensors.c,v 1.6 2006/05/27 22:23:49 henning Exp $ */
+/* $OpenBSD: sensors.c,v 1.7 2006/05/28 02:06:46 henning Exp $ */
/*
* Copyright (c) 2006 Henning Brauer <henning@openbsd.org>
@@ -207,6 +207,19 @@ sensor_hotplugevent(int fd)
if (n == sizeof(he))
switch (he.he_type) {
+ case HOTPLUG_DEVAT:
+ if (he.he_devclass == DV_SENSOR)
+ sensor_probe(he.he_devid);
+ break;
+ case HOTPLUG_DEVDT:
+ if (he.he_devclass == DV_SENSOR) {
+ struct ntp_sensor *s;
+
+ s = sensor_byid(he.he_devid);
+ if (s != NULL)
+ sensor_remove(s);
+ }
+ break;
default: /* ignore */
break;
}