libsensors: Missing sysfs busses and classes are not errors. This tends

to confuse users a lot, to report the lack of hwmon driver as an error.
prog/sensors: Clearer error messages when no sensors are found. The
most frequent cause is a lack of drivers, not procfs/sysfs problems.


git-svn-id: http://lm-sensors.org/svn/lm-sensors/trunk@4159 7894878c-1315-0410-8ee3-d5d059ff63e0
This commit is contained in:
Jean Delvare committed 2006-09-19 10:01:12 +00:00
1 parent c9bd83748b
commit 94fa667c46
3 files changed
+13 -8

No files matched your search

+2
View File
@@ -16,6 +16,7 @@ lm_sensors CHANGES file
Add support for the IT8716F and IT8718F chips
Add support for the W83793 chip (Yuan Mu)
Map the 2.6 adm1026's fan8 to fan0
Missing sysfs busses and classes are not errors
Makefile: Don't grep autoconf.h on user-space targets
Fix depmod on non-running kernel version
Module i2c-ali1535: Drop redundant semaphore (2.6 backport)
@@ -59,6 +60,7 @@ lm_sensors CHANGES file
Add w83793 support (Yuan Mu)
The adt7463 may not have in4 (#2119)
Hide more vt1211 missing input errors
Clearer error messages when no sensors found
Program sensors-detect: Add ServerWorks HT-1000 SMBus detection
Add ATI IXP200/300/400 SMBus detection
Prevent warning on 64-bit PCI addresses
+5 -4
View File
@@ -112,12 +112,13 @@ static int sensors_read_sysfs_chips_compat(void)
int ret = 0;
if (!(bus = sysfs_open_bus("i2c"))) {
ret = -SENSORS_ERR_PROC;
if (errno && errno != ENOENT)
ret = -SENSORS_ERR_PROC;
goto exit0;
}
if (!(devs = sysfs_get_bus_devices(bus))) {
if (errno)
if (errno && errno != ENOENT)
ret = -SENSORS_ERR_PROC;
goto exit1;
}
@@ -148,7 +149,7 @@ int sensors_read_sysfs_chips(void)
}
if (!(clsdevs = sysfs_get_class_devices(cls))) {
if (errno)
if (errno && errno != ENOENT)
ret = -SENSORS_ERR_PROC;
goto exit;
}
@@ -185,7 +186,7 @@ int sensors_read_sysfs_bus(void)
}
if (!(clsdevs = sysfs_get_class_devices(cls))) {
if (errno)
if (errno && errno != ENOENT)
ret = -SENSORS_ERR_PROC;
goto exit1;
}
+6 -4
View File
@@ -238,10 +238,9 @@ int main (int argc, char *argv[])
fprintf(stderr,"%s\n",sensors_strerror(res));
if (res == -SENSORS_ERR_PROC)
fprintf(stderr,
"Unable to find i2c bus information;\n"
"Kernel interface access error\n"
"For 2.6 kernels, make sure you have mounted sysfs and libsensors\n"
"was compiled with sysfs support!\n"
"For older kernels, make sure you have done 'modprobe i2c-proc'!\n");
"was compiled with sysfs support!\n");
exit(1);
}
@@ -256,7 +255,10 @@ int main (int argc, char *argv[])
exit(error);
} else {
if(chips[0].prefix == SENSORS_CHIP_NAME_PREFIX_ANY)
fprintf(stderr,"No sensors found!\n");
fprintf(stderr,
"No sensors found!\n"
"Make sure you loaded all the kernel drivers you need.\n"
"Try sensors-detect to find out which these are.\n");
else
fprintf(stderr,"Specified sensor(s) not found!\n");
sensors_cleanup();