Skip to content

Commit

Permalink
Check for cpu temperature in thermal class
Browse files Browse the repository at this point in the history
  • Loading branch information
divaprabhu authored and tpruvot committed Jun 20, 2021
1 parent a7df963 commit 9b94adc
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions sysinfos.c
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@
"/sys/class/hwmon/hwmon0/temp2_input"
#define HWMON_ALT5 \
"/sys/class/hwmon/hwmon0/device/temp1_input"
#define HWMON_ALT6 \
"/sys/class/thermal/thermal_zone0/temp"

static float linux_cputemp(int core)
{
Expand All @@ -47,6 +49,9 @@ static float linux_cputemp(int core)
if (!fd)
fd = fopen(HWMON_ALT5, "r");

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

if (!fd)
return tc;

Expand Down

0 comments on commit 9b94adc

Please sign in to comment.