From aa47fb99e2e3c6693debb7369c1611930aa5194d Mon Sep 17 00:00:00 2001 From: Jean Delvare Date: Mon, 12 May 2008 11:51:18 +0000 Subject: [PATCH] Fix support of multiple chip names on the command line. It got broken accidentally during the conversion to the new libsensors API in version 3.0.0. This closes ticket #2321. git-svn-id: http://lm-sensors.org/svn/lm-sensors/branches/lm-sensors-3.0.0@5252 7894878c-1315-0410-8ee3-d5d059ff63e0 --- CHANGES | 2 ++ prog/sensord/rrd.c | 3 ++- prog/sensord/sense.c | 3 ++- 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/CHANGES b/CHANGES index 2c13d028..1ac3f280 100644 --- a/CHANGES +++ b/CHANGES @@ -8,12 +8,14 @@ SVN-HEAD Late compute statements override early ones Support virtual hwmon devices (#2309) Support power and energy sensors + Support DOS-style configuration files again (#2284) pwmconfig: Don't create the configuration file before it's needed Don't preserve configuration file customizations Fix permissions of the configuration file Don't start if fancontrol is running (#2299) fancontrol: Don't start if already running (#2299) Delete fancontrol.pid at exit time (#2299) + sensord: Fix support of multiple chip names on the command line (#2321) sensors: Print energy and power sensors with automatically scaled units sensors-detect: Add SMSC SCH5027D detection Do not access I/O ports on PPC diff --git a/prog/sensord/rrd.c b/prog/sensord/rrd.c index 2f359e37..219cefbf 100644 --- a/prog/sensord/rrd.c +++ b/prog/sensord/rrd.c @@ -136,9 +136,10 @@ static int applyToFeatures (FeatureFN fn, void *data) { const sensors_chip_name *chip; - int i = 0, j, ret = 0, num = 0; + int i, j, ret = 0, num = 0; for (j = 0; (ret == 0) && (j < numChipNames); ++ j) { + i = 0; while ((ret == 0) && ((chip = sensors_get_detected_chips (&chipNames[j], &i)) != NULL)) { int index0, chipindex = -1; for (index0 = 0; knownChips[index0].features; ++ index0) diff --git a/prog/sensord/sense.c b/prog/sensord/sense.c index eb9d051b..3dc61178 100644 --- a/prog/sensord/sense.c +++ b/prog/sensord/sense.c @@ -170,9 +170,10 @@ static int doChips (int action) { const sensors_chip_name *chip; - int i = 0, j, ret = 0; + int i, j, ret = 0; for (j = 0; (ret == 0) && (j < numChipNames); ++ j) { + i = 0; while ((ret == 0) && ((chip = sensors_get_detected_chips (&chipNames[j], &i)) != NULL)) { ret = doChip (chip, action); }