diff options
author | Alexander Vasarab <alexander@vasaconsulting.com> | 2014-04-29 15:30:11 -0700 |
---|---|---|
committer | Michael Stapelberg <michael@stapelberg.de> | 2014-04-30 09:28:09 +0200 |
commit | b26b118d76ab32cbff7ca6e5def69ca7bfbf6aa0 (patch) | |
tree | a391b1eee7f097625a474ac1d31c9016cf513d39 /include/i3status.h | |
parent | 628149b22761fd2bff7b81bda18fcc50bc11529c (diff) |
Fix NetBSD CPU temp gauge bug
This patch fixes a bug in which multiple (conflicting) CPU temps may be
included in the output for the "cpu temperature" module.
The bug is due to the way that the code parsed the envsys(4)-returned data,
and would manifest itself on x86-based NetBSD machines, since those use
cputemp(4) as well as acpitz(4), thereby creating multiple envsys(4) entries
with identical descriptions but which refer to different physical sensors.
Instead of matching the description attribute of each device returned by
envsys(4) against the target format, this patch throws away non-matching keys
in the first instruction inside the dict walk. This has the benefit of sparing
unnecessary CPU cycles, and preventing other sensors from being included
erroneously.
Additionally, the THERMAL_ZONE format is now joined with OpenBSD in that it
uses acpitz(4) explicitly. This is prefered since it is much older (dating
back to NetBSD 2.0), and does not exclude x86-based users (as with cputemp(4)).
Diffstat (limited to 'include/i3status.h')
-rw-r--r-- | include/i3status.h | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/include/i3status.h b/include/i3status.h index 829fc4e..4c63305 100644 --- a/include/i3status.h +++ b/include/i3status.h @@ -30,12 +30,9 @@ enum { O_DZEN2, O_XMOBAR, O_I3BAR, O_TERM, O_NONE } output_format; #define BATT_TIME "hw.acpi.battery.time" #define BATT_STATE "hw.acpi.battery.state" -#elif defined(__OpenBSD__) +#elif defined(__OpenBSD__) || defined(__NetBSD__) /* Default to acpitz(4) if no path is set. */ #define THERMAL_ZONE "acpitz%d" -#elif defined(__NetBSD__) -/* Rely on envsys(4). The key of the sensor is generally cpu%d temperature */ -#define THERMAL_ZONE "cpu%d temperature" #endif #if defined(__FreeBSD_kernel__) && defined(__GLIBC__) |