Browse Source

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" <cnst+openbsd@bugmail.mojo.ru>
OPENBSD_4_1
henning 18 years ago
parent
commit
5a0d6270be
1 changed files with 5 additions and 1 deletions
  1. +5
    -1
      src/usr.sbin/ntpd/sensors.c

+ 5
- 1
src/usr.sbin/ntpd/sensors.c View File

@ -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 <henning@openbsd.org> * Copyright (c) 2006 Henning Brauer <henning@openbsd.org>
@ -76,6 +76,10 @@ sensor_probe(int devid, char *dxname, struct sensor *sensor)
log_warn("sensor_probe sysctl"); log_warn("sensor_probe sysctl");
return (0); return (0);
} }
if (sensordev.maxnumt[SENSOR_TIMEDELTA] == 0)
return (0);
strlcpy(dxname, sensordev.xname, MAXDEVNAMLEN); strlcpy(dxname, sensordev.xname, MAXDEVNAMLEN);
slen = sizeof(*sensor); slen = sizeof(*sensor);


Loading…
Cancel
Save