From 2078c067b1e62832fb239793d444cc8f9ffceaeb Mon Sep 17 00:00:00 2001 From: jamesbond Date: Fri, 13 Feb 2015 04:33:52 +0000 Subject: update sensors.c to work with kernel 3.18.x --- modules/devices/sensors.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'modules/devices/sensors.c') diff --git a/modules/devices/sensors.c b/modules/devices/sensors.c index be66afc7..062298d4 100644 --- a/modules/devices/sensors.c +++ b/modules/devices/sensors.c @@ -154,16 +154,16 @@ static char *get_sensor_path(int number) { char *path, *last_slash; - path = g_strdup_printf("/sys/class/hwmon/hwmon%d/device", number); - if (g_file_test(path, G_FILE_TEST_EXISTS)) { + path = g_strdup_printf("/sys/class/hwmon/hwmon%d", number); + if (g_file_test(path, G_FILE_TEST_EXISTS | G_FILE_TEST_IS_DIR)) { return path; } - +/* we start at the top of hwmon, this fallback is not needed anymore if ((last_slash = strrchr(path, '/'))) { *last_slash = '\0'; return path; } - +*/ g_free(path); return NULL; } @@ -172,7 +172,7 @@ static char *determine_driver_for_hwmon_path(char *path) { char *tmp, *driver; - tmp = g_strdup_printf("%s/driver", path); + tmp = g_strdup_printf("%s/device/driver", path); driver = g_file_read_link(tmp, NULL); g_free(tmp); -- cgit v1.2.3