mirror of
https://github.com/lm-sensors/lm-sensors
synced 2025-08-31 14:25:39 +00:00
Fix a bug in libsensors which caused some failed feature writes
("set lines") to go unnoticed. lm78's fan3_div (which is read-only but stored in a R/W file in procfs) was one of them. Make sensors' error message in this case more explicit. git-svn-id: http://lm-sensors.org/svn/lm-sensors/trunk@2692 7894878c-1315-0410-8ee3-d5d059ff63e0
This commit is contained in:
@@ -425,8 +425,8 @@ int sensors_do_this_chip_sets(sensors_chip_name name)
|
||||
{
|
||||
sensors_chip *chip;
|
||||
double value;
|
||||
int err,i,j;
|
||||
int res = 0;
|
||||
int i, j;
|
||||
int err = 0, res;
|
||||
const sensors_chip_feature *feature;
|
||||
int *feature_list = NULL;
|
||||
int feature_count = 0;
|
||||
@@ -464,7 +464,7 @@ int sensors_do_this_chip_sets(sensors_chip_name name)
|
||||
}
|
||||
}
|
||||
free(feature_list);
|
||||
return res;
|
||||
return err;
|
||||
}
|
||||
|
||||
/* Execute all set statements for this particular chip. The chip may contain
|
||||
|
@@ -328,6 +328,9 @@ int do_a_set(sensors_chip_name name)
|
||||
sensors_strerror(res));
|
||||
fprintf(stderr,"Run as root?\n");
|
||||
return 1;
|
||||
} else if (res == -SENSORS_ERR_ACCESS_W) {
|
||||
fprintf(stderr, "%s: At least one \"set\" statement failed\n",
|
||||
sprintf_chip_name(name));
|
||||
} else {
|
||||
fprintf(stderr,"%s: %s\n",sprintf_chip_name(name),
|
||||
sensors_strerror(res));
|
||||
|
Reference in New Issue
Block a user