From 3ff2df927bc47945e046836e8efa5217612eeeaf Mon Sep 17 00:00:00 2001 From: Jean Delvare Date: Sat, 8 Sep 2007 10:47:03 +0000 Subject: [PATCH] Fix sensors output when a temperature channel has a critical limit but no max limit (for example the coretemp driver.) git-svn-id: http://lm-sensors.org/svn/lm-sensors/branches/lm-sensors-3.0.0@4791 7894878c-1315-0410-8ee3-d5d059ff63e0 --- prog/sensors/chips.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/prog/sensors/chips.c b/prog/sensors/chips.c index 72a8fcbe..54e08a08 100644 --- a/prog/sensors/chips.c +++ b/prog/sensors/chips.c @@ -198,6 +198,22 @@ static void print_chip_temp(const sensors_chip_name *name, s2 = NULL; } } + } else if (TEMP_FEATURE(SENSORS_FEATURE_TEMP_CRIT)) { + limit1 = TEMP_FEATURE_VAL(SENSORS_FEATURE_TEMP_CRIT); + s1 = "crit"; + + if (TEMP_FEATURE(SENSORS_FEATURE_TEMP_CRIT_HYST)) { + limit2 = TEMP_FEATURE_VAL(SENSORS_FEATURE_TEMP_CRIT_HYST); + s2 = "hyst"; + } else { + limit2 = 0; + s2 = NULL; + } + + if (TEMP_FEATURE(SENSORS_FEATURE_TEMP_CRIT_ALARM) && + TEMP_FEATURE_VAL(SENSORS_FEATURE_TEMP_CRIT_ALARM)) + alarm |= 1; + crit_displayed = 1; } else { limit1 = limit2 = 0; s1 = s2 = NULL;