Browse Source

add sensor_byid(), return sensor by its id

OPENBSD_4_0
henning 18 years ago
parent
commit
54fb320578
1 changed files with 16 additions and 3 deletions
  1. +16
    -3
      src/usr.sbin/ntpd/sensors.c

+ 16
- 3
src/usr.sbin/ntpd/sensors.c View File

@ -1,4 +1,4 @@
/* $OpenBSD: sensors.c,v 1.5 2006/05/27 22:22:47 henning Exp $ */
/* $OpenBSD: sensors.c,v 1.6 2006/05/27 22:23:49 henning Exp $ */
/*
* Copyright (c) 2006 Henning Brauer <henning@openbsd.org>
@ -34,8 +34,9 @@
#define SENSORS_MAX 255
#define _PATH_DEV_HOTPLUG "/dev/hotplug"
void sensor_probe(int);
void sensor_add(struct sensor *);
void sensor_probe(int);
void sensor_add(struct sensor *);
struct ntp_sensor *sensor_byid(int);
struct ntpd_conf *conf;
@ -117,6 +118,18 @@ sensor_remove(struct ntp_sensor *s)
free(s);
}
struct ntp_sensor *
sensor_byid(int id)
{
struct ntp_sensor *s;
TAILQ_FOREACH(s, &conf->ntp_sensors, entry)
if (s->sensorid == id)
return(s);
return (NULL);
}
int
sensor_query(struct ntp_sensor *s)
{


Loading…
Cancel
Save