diff options
author | madpilot <madpilot@FreeBSD.org> | 2016-10-05 04:07:15 +0800 |
---|---|---|
committer | madpilot <madpilot@FreeBSD.org> | 2016-10-05 04:07:15 +0800 |
commit | 82be865e42b015b5c89673a20b0128beb4e5aa0e (patch) | |
tree | 483d1868a779af0b7b3a138ecc3e94a95a2a1a9c /sysutils/conky | |
parent | e6218088d06d3f7bd567bf6fe45fe5dcf3e302f6 (diff) | |
download | freebsd-ports-gnome-82be865e42b015b5c89673a20b0128beb4e5aa0e.tar.gz freebsd-ports-gnome-82be865e42b015b5c89673a20b0128beb4e5aa0e.tar.zst freebsd-ports-gnome-82be865e42b015b5c89673a20b0128beb4e5aa0e.zip |
Make conky try to get CPU temperature from more than just one sysctl.
PR: 210235
Submitted by: walter@pelissero.de
Diffstat (limited to 'sysutils/conky')
-rw-r--r-- | sysutils/conky/Makefile | 1 | ||||
-rw-r--r-- | sysutils/conky/files/patch-src_freebsd.cc | 24 |
2 files changed, 25 insertions, 0 deletions
diff --git a/sysutils/conky/Makefile b/sysutils/conky/Makefile index 416ae226d0a3..f614aa14f74f 100644 --- a/sysutils/conky/Makefile +++ b/sysutils/conky/Makefile @@ -4,6 +4,7 @@ PORTNAME= conky PORTVERSION= 1.10.5 DISTVERSIONPREFIX= v +PORTREVISION= 1 CATEGORIES= sysutils MAINTAINER= madpilot@FreeBSD.org diff --git a/sysutils/conky/files/patch-src_freebsd.cc b/sysutils/conky/files/patch-src_freebsd.cc new file mode 100644 index 000000000000..e39353924531 --- /dev/null +++ b/sysutils/conky/files/patch-src_freebsd.cc @@ -0,0 +1,24 @@ +--- src/freebsd.cc.orig 2016-10-04 07:49:19 UTC ++++ src/freebsd.cc +@@ -426,13 +426,15 @@ double get_acpi_temperature(int fd) + int temp; + (void)fd; + +- if (GETSYSCTL("hw.acpi.thermal.tz0.temperature", temp)) { +- fprintf(stderr, +- "Cannot read sysctl \"hw.acpi.thermal.tz0.temperature\"\n"); +- return 0.0; +- } ++ if (GETSYSCTL("hw.acpi.thermal.tz0.temperature", temp) == 0) ++ return KELVTOC(temp); ++ if (GETSYSCTL("dev.cpu.0.temperature", temp) == 0) ++ return KELVTOC(temp); ++ if (GETSYSCTL("dev.amdtemp.0.core0.sensor0", temp) == 0) ++ return KELVTOC(temp); ++ fprintf(stderr, "Cannot get temperature from sysctl\n"); + +- return KELVTOC(temp); ++ return 0.0; + } + + static void get_battery_stats(int *battime, int *batcapacity, int *batstate, int *ac) { |