diff options
author | 2006-05-28 02:06:46 +0000 | |
---|---|---|
committer | 2006-05-28 02:06:46 +0000 | |
commit | 79416362d35ddc4902e16263c4077f335f99dfbe (patch) | |
tree | 7f86cf433964c8f82d9a42459c7151226f9cfdbe | |
parent | Only preemptively increase the replay counter for outbound TDBs. (diff) | |
download | wireguard-openbsd-79416362d35ddc4902e16263c4077f335f99dfbe.tar.xz wireguard-openbsd-79416362d35ddc4902e16263c4077f335f99dfbe.zip |
make use of the new hotplug events for sensors showing up or vanishing
-rw-r--r-- | usr.sbin/ntpd/sensors.c | 15 |
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; } |