diff options
author | Alexander Yurchenko <grange@cvs.openbsd.org> | 2006-01-19 17:08:41 +0000 |
---|---|---|
committer | Alexander Yurchenko <grange@cvs.openbsd.org> | 2006-01-19 17:08:41 +0000 |
commit | ae36f2054b5612aa7968cc0b722e6fd9f0446df1 (patch) | |
tree | 36f0c710576bef0a2dd796b1b8893ee1c0480afe /sys/kern/kern_sysctl.c | |
parent | 5ddc9bd0d1112ccc5b376dcad408e01de66a48b8 (diff) |
Replace SENSOR_ADD() macro with a pair of functions
sensor_add()/sensor_del() so that sensors can be attached
and detached dynamicaly.
ok kettenis@ deraadt@ dlg@
Diffstat (limited to 'sys/kern/kern_sysctl.c')
-rw-r--r-- | sys/kern/kern_sysctl.c | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/sys/kern/kern_sysctl.c b/sys/kern/kern_sysctl.c index c81437b56c1..516f1281964 100644 --- a/sys/kern/kern_sysctl.c +++ b/sys/kern/kern_sysctl.c @@ -1,4 +1,4 @@ -/* $OpenBSD: kern_sysctl.c,v 1.136 2005/11/28 00:14:29 jsg Exp $ */ +/* $OpenBSD: kern_sysctl.c,v 1.137 2006/01/19 17:08:40 grange Exp $ */ /* $NetBSD: kern_sysctl.c,v 1.17 1996/05/20 17:49:05 mrg Exp $ */ /*- @@ -1754,14 +1754,12 @@ sysctl_sensors(int *name, u_int namelen, void *oldp, size_t *oldlenp, return (ENOTDIR); num = name[0]; - if (num < 0 || num >= _sensors_count) - return (ENXIO); - SLIST_FOREACH(s, &_sensors_list, list) if (s->num == num) - break; + return (sysctl_rdstruct(oldp, oldlenp, newp, s, + sizeof(struct sensor))); - return (sysctl_rdstruct(oldp, oldlenp, newp, s, sizeof(struct sensor))); + return (ENOENT); } int |