mirror of
https://github.com/Llewellynvdm/conky.git
synced 2024-11-15 09:44:04 +00:00
hwmon: Fix device name path for some devices.
This commit is contained in:
parent
ae733352f1
commit
53973402b4
@ -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);
|
snprintf(path, 512, "%s%s/name", dir, namelist[i]->d_name);
|
||||||
name_fd = open(path, O_RDONLY);
|
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));
|
size = read(name_fd, name, strlen(dev));
|
||||||
if (size < strlen(dev)) {
|
if (size < strlen(dev)) {
|
||||||
close(name_fd);
|
close(name_fd);
|
||||||
|
Loading…
Reference in New Issue
Block a user