Skip to contentSkip to conversation

libsysfs 2.x bug affects libsensors

lm-sensors Jean Delvare 1 participant 1 message Sep 28, 2006

lore
Share & tools
lore
#0 lore raw

Hi all,

I just noticed that libsysfs 2.x has a bug (or at least a serious mis-feature) which affects libsensors.

Since lm_sensors 2.10.0, libsensors relies on sysfs_get_mnt_path() to find out whether sysfs is available or not, and fallbacks to procfs to get the sensors data if it isn't. With libsysfs 1.x it worked fine, as sysfs_get_mnt_path() would fail is sysfs wasn't mounted. However, since libsysfs 2.0.0, sysfs_get_mnt_path() appears to succeed even if sysfs isn't mounted. As a consequence, a sysfs-enabled libsensors will not work on a 2.4 kernel. So there is currently no way to build libsensors so that it'll work on both 2.4 and 2.6 kernels, unless you go back to libsysfs 1.3.0.

I opened a bug on sourceforge:
http://sourceforge.net/tracker/index.php?func�tail&aid67053&group_idD427&atidC9544

There are several quick fixes possible... Testing the string returned by "uname -r", looking for sysfs in /proc/mounts, testing if /sys/bus exists, or the other way around, testing if /proc/sys/dev/sensors exists.

Or we could stop using libsysfs altogether...

Signature · 1 line
Jean Delvare