Sophie

Sophie

distrib > Fedora > 14 > x86_64 > by-pkgid > b007627aef7a02ff4a8f0808ac530919 > files > 4

lcd4linux-0.11-0.2.svn1143.fc14.src.rpm

diff -ur trunk/plugin_i2c_sensors.c trunk.new/plugin_i2c_sensors.c
--- trunk/plugin_i2c_sensors.c	2010-01-17 14:40:02.000000000 +0100
+++ trunk.new/plugin_i2c_sensors.c	2011-02-20 15:52:34.868010987 +0100
@@ -223,6 +223,8 @@
     int done;
 
     if (!strcmp(method, "sysfs")) {
+	base = "/sys/class/hwmon/";
+    } else if (!strcmp(method, "sysfs-old")) {
 	base = "/sys/bus/i2c/devices/";
     } else if (!strcmp(method, "procfs")) {
 	base = "/proc/sys/dev/sensors/";
@@ -259,6 +261,16 @@
 		done = 1;
 		break;
 	    }
+	    if (!strcmp(file->d_name, "device")) {
+	        char fname[PATH_MAX];
+	        snprintf(fname, PATH_MAX, "%sdevice/temp1_input", dname);
+                if (access(fname, R_OK) == 0) {
+                    path = realloc(path, strlen(dname) + 7);
+                    sprintf(path, "%sdevice/", dname);
+                    done = 1;
+                    break;
+                }
+	    }
 	}
 	closedir(fd2);
 	if (done)
@@ -281,6 +293,8 @@
 	/* debug("No path to i2c sensors found in the conf, calling my_i2c_sensors_path()"); */
 	my_i2c_sensors_path("sysfs");
 	if (!path)
+	    my_i2c_sensors_path("sysfs-old");
+	if (!path)
 	    my_i2c_sensors_path("procfs");
 
 	if (!path) {
Only in trunk.new: plugin_i2c_sensors.c~