Fix hwmon location for kernel >= 2.6.31 (closes sf: #2865628)
authorCesare Tirabassi <norsetto@ubuntu.com>
Sun, 1 Nov 2009 17:37:48 +0000 (18:37 +0100)
committerCesare Tirabassi <norsetto@ubuntu.com>
Sun, 1 Nov 2009 17:37:48 +0000 (18:37 +0100)
commit4ea99e27f17d5ae2bc5e58d8a8782d39a921fe46
treebd17f3cebcf255834099b2b4712cf78d972aa3d1
parentf7f3b3780798c655aa250a6536ea1fa7b7d23cf3
Fix hwmon location for kernel >= 2.6.31 (closes sf: #2865628)

In the linux kernel 2.6.31 and above, device data can either be in
/sys/class/hwmon/hwmonDEV or /sys/class/hwmon/hwmonDEV/device.
Just stat'ing for the latter doesn't work since it can exist but not contain
the required data (see https://bugs.launchpad.net/bugs/435571 for details).
The patch could be improved to keep in memory the right location of the data
on the user's system instead of trying each time, but, is it worth doing it?
src/linux.c