diff options
author | jamesbond <jamesbond> | 2015-02-13 04:33:52 +0000 |
---|---|---|
committer | Leandro Pereira <leandro@hardinfo.org> | 2015-10-25 15:49:33 -0200 |
commit | 2078c067b1e62832fb239793d444cc8f9ffceaeb (patch) | |
tree | 9f1ed19b4c089185a9f2344ce24a7c9e07f2d6fe /modules/devices | |
parent | ed99fc74e637e7b62c907fb77c41dd331a955fa9 (diff) |
update sensors.c to work with kernel 3.18.x
Diffstat (limited to 'modules/devices')
-rw-r--r-- | modules/devices/sensors.c | 10 |
1 files changed, 5 insertions, 5 deletions
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); |