diff options
author | David Gwynne <dlg@cvs.openbsd.org> | 2005-11-21 13:47:53 +0000 |
---|---|---|
committer | David Gwynne <dlg@cvs.openbsd.org> | 2005-11-21 13:47:53 +0000 |
commit | 986ba61d9f0cf9d15ff6421d3d96d4fbe0360507 (patch) | |
tree | 5a6c908d34fd465ab7a26400a2ef0dd4bd08b3e8 /sys/kern | |
parent | bc02267770d4da76b22ab297041b9b9bfb720de1 (diff) |
rename the sensor globals to names that are not obvious to avoid
collisions with local variable names someone might make. this has bitten
me twice now and caused me to lose about 4 hours scratching my head when
nsensors just magically corrupts and gets bigger. at least my ram isnt
screwed.
ok marco@
Diffstat (limited to 'sys/kern')
-rw-r--r-- | sys/kern/kern_sensors.c | 6 | ||||
-rw-r--r-- | sys/kern/kern_sysctl.c | 6 |
2 files changed, 6 insertions, 6 deletions
diff --git a/sys/kern/kern_sensors.c b/sys/kern/kern_sensors.c index 3268ae7e388..93e90daf5fe 100644 --- a/sys/kern/kern_sensors.c +++ b/sys/kern/kern_sensors.c @@ -1,4 +1,4 @@ -/* $OpenBSD: kern_sensors.c,v 1.4 2005/11/13 22:41:56 dlg Exp $ */ +/* $OpenBSD: kern_sensors.c,v 1.5 2005/11/21 13:47:52 dlg Exp $ */ /* * Copyright (c) 2005 David Gwynne <dlg@openbsd.org> @@ -27,8 +27,8 @@ #include <sys/sensors.h> -int nsensors = 0; -struct sensors_head sensors = SLIST_HEAD_INITIALIZER(&sensors); +int _sensors_count = 0; +struct sensors_head _sensors_list = SLIST_HEAD_INITIALIZER(&_sensors_list); struct sensor_task { void *arg; diff --git a/sys/kern/kern_sysctl.c b/sys/kern/kern_sysctl.c index c4980064163..c412884b2c4 100644 --- a/sys/kern/kern_sysctl.c +++ b/sys/kern/kern_sysctl.c @@ -1,4 +1,4 @@ -/* $OpenBSD: kern_sysctl.c,v 1.134 2005/11/19 02:18:01 pedro Exp $ */ +/* $OpenBSD: kern_sysctl.c,v 1.135 2005/11/21 13:47:52 dlg Exp $ */ /* $NetBSD: kern_sysctl.c,v 1.17 1996/05/20 17:49:05 mrg Exp $ */ /*- @@ -1839,10 +1839,10 @@ sysctl_sensors(int *name, u_int namelen, void *oldp, size_t *oldlenp, return (ENOTDIR); num = name[0]; - if (num < 0 || num >= nsensors) + if (num < 0 || num >= _sensors_count) return (ENXIO); - SLIST_FOREACH(s, &sensors, list) + SLIST_FOREACH(s, &_sensors_list, list) if (s->num == num) break; |