From 53973402b4fda399267c225b9fc7395ed862bde9 Mon Sep 17 00:00:00 2001 From: Ben Kibbey Date: Tue, 26 Sep 2023 21:03:51 -0700 Subject: [PATCH] hwmon: Fix device name path for some devices. --- src/linux.cc | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/linux.cc b/src/linux.cc index 5d2c3983..4e6609d0 100644 --- a/src/linux.cc +++ b/src/linux.cc @@ -1213,7 +1213,12 @@ static void get_dev_path(const char *dir, const char *dev, char *out_buf) { snprintf(path, 512, "%s%s/name", dir, namelist[i]->d_name); name_fd = open(path, O_RDONLY); - if (name_fd < 0) continue; + if (name_fd < 0) { + snprintf(path, 512, "%s%s/device/name", dir, namelist[i]->d_name); + name_fd = open(path, O_RDONLY); + if (name_fd < 0) + continue; + } size = read(name_fd, name, strlen(dev)); if (size < strlen(dev)) { close(name_fd);