diff options
author | Henning Brauer <henning@cvs.openbsd.org> | 2006-05-28 18:48:21 +0000 |
---|---|---|
committer | Henning Brauer <henning@cvs.openbsd.org> | 2006-05-28 18:48:21 +0000 |
commit | 1ca21d874f210bb6dfc8ee7395785d69089ec8fc (patch) | |
tree | 1f3afe5c2ce8e0ac1e90be9970352e533ab0a7e8 /usr.sbin/ntpd/sensors.c | |
parent | ac47cdc0d1fc902b73a1362cc0216a37fae14ee7 (diff) |
if sysctl gives ENOENT the sensor is gone and we remove it
Diffstat (limited to 'usr.sbin/ntpd/sensors.c')
-rw-r--r-- | usr.sbin/ntpd/sensors.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/usr.sbin/ntpd/sensors.c b/usr.sbin/ntpd/sensors.c index e3b19e15ce7..0b26937deb2 100644 --- a/usr.sbin/ntpd/sensors.c +++ b/usr.sbin/ntpd/sensors.c @@ -1,4 +1,4 @@ -/* $OpenBSD: sensors.c,v 1.12 2006/05/28 18:47:25 henning Exp $ */ +/* $OpenBSD: sensors.c,v 1.13 2006/05/28 18:48:20 henning Exp $ */ /* * Copyright (c) 2006 Henning Brauer <henning@openbsd.org> @@ -134,7 +134,10 @@ sensor_query(struct ntp_sensor *s) mib[2] = s->sensorid; len = sizeof(sensor); if (sysctl(mib, 3, &sensor, &len, NULL, 0) == -1) { - log_warn("sensor_query sysctl"); + if (errno == ENOENT) + sensor_remove(s); + else + log_warn("sensor_query sysctl"); return; } |