1
0
mirror of https://github.com/Llewellynvdm/conky.git synced 2024-12-25 12:10:03 +00:00

hwmon: Fix device name path for some devices.

This commit is contained in:
Ben Kibbey 2023-09-26 21:03:51 -07:00 committed by Brenden Matthews
parent ae733352f1
commit 53973402b4

View File

@ -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);