sensors: Better handling of the fault flags.

git-svn-id: http://lm-sensors.org/svn/lm-sensors/branches/lm-sensors-3.0.0@4910 7894878c-1315-0410-8ee3-d5d059ff63e0
This commit is contained in:
Jean Delvare committed 2007-09-30 17:56:19 +00:00
1 parent 647b47cb6a
commit e012d14d95
2 files changed
+18 -13

No files matched your search

+1
View File
@@ -10,6 +10,7 @@ SVN
sensors: Fix spurious critical temperature alarm
Print error messages to stderr
Make error messages more helpful and consistent
Better handling of the fault flags
sensors-conf-convert: Add a short help text
3.0.0-rc1 (2007-09-25)
+17 -13
View File
@@ -147,10 +147,6 @@ static void print_chip_temp(const sensors_chip_name *name,
print_label(label, label_size);
free(label);
sf = sensors_get_subfeature(name, feature,
SENSORS_SUBFEATURE_TEMP_INPUT);
val = sf ? get_value(name, sf) : 0;
sf = sensors_get_subfeature(name, feature,
SENSORS_SUBFEATURE_TEMP_ALARM);
alarm = sf && get_value(name, sf);
@@ -230,9 +226,15 @@ static void print_chip_temp(const sensors_chip_name *name,
if (sf && get_value(name, sf)) {
printf(" FAULT ");
} else {
if (fahrenheit)
val = deg_ctof(val);
printf("%+6.1f%s ", val, degstr);
sf = sensors_get_subfeature(name, feature,
SENSORS_SUBFEATURE_TEMP_INPUT);
if (sf) {
val = get_value(name, sf);
if (fahrenheit)
val = deg_ctof(val);
printf("%+6.1f%s ", val, degstr);
} else
printf(" N/A ");
}
print_temp_limits(limit1, limit2, s1, s2, alarm);
@@ -350,7 +352,6 @@ static void print_chip_fan(const sensors_chip_name *name,
{
const sensors_subfeature *sf, *sfmin, *sfdiv;
char *label;
double val;
if (!(label = sensors_get_label(name, feature))) {
fprintf(stderr, "ERROR: Can't get label of feature %s!\n",
@@ -360,15 +361,18 @@ static void print_chip_fan(const sensors_chip_name *name,
print_label(label, label_size);
free(label);
sf = sensors_get_subfeature(name, feature,
SENSORS_SUBFEATURE_FAN_INPUT);
val = sf ? get_value(name, sf) : 0;
sf = sensors_get_subfeature(name, feature,
SENSORS_SUBFEATURE_FAN_FAULT);
if (sf && get_value(name, sf))
printf(" FAULT");
else
printf("%4.0f RPM", val);
else {
sf = sensors_get_subfeature(name, feature,
SENSORS_SUBFEATURE_FAN_INPUT);
if (sf)
printf("%4.0f RPM", get_value(name, sf));
else
printf(" N/A");
}
sfmin = sensors_get_subfeature(name, feature,
SENSORS_SUBFEATURE_FAN_MIN);