From 5a0d6270be5784f79c3ccc49b1129c4ba5d4e4f3 Mon Sep 17 00:00:00 2001 From: henning <> Date: Mon, 15 Jan 2007 19:58:49 +0000 Subject: [PATCH] the new sensors tre can give us the number of sensors per type. With this patch, we give up without bothering sysctl kern_sensors.c::sensor_find() unless we know for sure that timedelta sensor is present. From: "Constantine A. Murenin" --- src/usr.sbin/ntpd/sensors.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/usr.sbin/ntpd/sensors.c b/src/usr.sbin/ntpd/sensors.c index 1058a341..79f6da92 100644 --- a/src/usr.sbin/ntpd/sensors.c +++ b/src/usr.sbin/ntpd/sensors.c @@ -1,4 +1,4 @@ -/* $OpenBSD: sensors.c,v 1.30 2007/01/15 08:19:11 otto Exp $ */ +/* $OpenBSD: sensors.c,v 1.31 2007/01/15 19:58:49 henning Exp $ */ /* * Copyright (c) 2006 Henning Brauer @@ -76,6 +76,10 @@ sensor_probe(int devid, char *dxname, struct sensor *sensor) log_warn("sensor_probe sysctl"); return (0); } + + if (sensordev.maxnumt[SENSOR_TIMEDELTA] == 0) + return (0); + strlcpy(dxname, sensordev.xname, MAXDEVNAMLEN); slen = sizeof(*sensor);