Skip to content

Commit

Permalink
Some other hwmon paths may be present
Browse files Browse the repository at this point in the history
  • Loading branch information
g1itch authored and tpruvot committed Feb 5, 2016
1 parent 2712075 commit 2220b21
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions sysinfos.c
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,12 @@
"/sys/class/hwmon/hwmon1/temp1_input"
#define HWMON_ALT2 \
"/sys/class/hwmon/hwmon0/temp1_input"
#define HWMON_ALT3 \
"/sys/devices/platform/coretemp.0/hwmon/hwmon0/temp2_input"
#define HWMON_ALT4 \
"/sys/class/hwmon/hwmon0/temp2_input"
#define HWMON_ALT5 \
"/sys/class/hwmon/hwmon0/device/temp1_input"

static float linux_cputemp(int core)
{
Expand All @@ -32,6 +38,15 @@ static float linux_cputemp(int core)
if (!fd)
fd = fopen(HWMON_ALT2, "r");

if (!fd)
fd = fopen(HWMON_ALT3, "r");

if (!fd)
fd = fopen(HWMON_ALT4, "r");

if (!fd)
fd = fopen(HWMON_ALT5, "r");

if (!fd)
return tc;

Expand Down

0 comments on commit 2220b21

Please sign in to comment.