From c84fd9820ef6163ec57fb2d947a1a4c3d9503385 Mon Sep 17 00:00:00 2001 From: Jean Delvare Date: Fri, 11 Apr 2008 20:41:31 +0000 Subject: [PATCH] We start at the end of the chip list, going backwards, and we want the late compute statements to override the early ones (as documented in the sensors.conf manual page), so we must stop as soon as any match is found. This fixes Debian bug #474596: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=474596 git-svn-id: http://lm-sensors.org/svn/lm-sensors/branches/lm-sensors-3.0.0@5175 7894878c-1315-0410-8ee3-d5d059ff63e0 --- CHANGES | 1 + lib/access.c | 6 ++++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/CHANGES b/CHANGES index abb40df7..bcd9fcef 100644 --- a/CHANGES +++ b/CHANGES @@ -4,6 +4,7 @@ lm-sensors CHANGES file SVN-HEAD libsensors: Use __func__ instead of __FUNCTION__ Parse the configuration file in C locale + Late compute statements override early ones sensors-detect: Add SMSC SCH5027D detection Do not access I/O ports on PPC Move south bridge sensor detection to the right section diff --git a/lib/access.c b/lib/access.c index c112b6e4..ef1e6a55 100644 --- a/lib/access.c +++ b/lib/access.c @@ -249,7 +249,8 @@ int sensors_get_value(const sensors_chip_name *name, int subfeat_nr, subfeature->mapping); chip = NULL; - while ((chip = sensors_for_all_config_chips(name, chip))) + while (!expr && + (chip = sensors_for_all_config_chips(name, chip))) for (i = 0; i < chip->computes_count; i++) { if (!strcmp(feature->name, chip->computes[i].name)) { @@ -300,7 +301,8 @@ int sensors_set_value(const sensors_chip_name *name, int subfeat_nr, subfeature->mapping); chip = NULL; - while ((chip = sensors_for_all_config_chips(name, chip))) + while (!expr && + (chip = sensors_for_all_config_chips(name, chip))) for (i = 0; i < chip->computes_count; i++) { if (!strcmp(feature->name, chip->computes[i].name)) {