]> git.sur5r.net Git - i3/i3status/commit
Fix NetBSD CPU temp gauge bug
authorAlexander Vasarab <alexander@vasaconsulting.com>
Tue, 29 Apr 2014 22:30:11 +0000 (15:30 -0700)
committerMichael Stapelberg <michael@stapelberg.de>
Wed, 30 Apr 2014 07:28:09 +0000 (09:28 +0200)
commitb26b118d76ab32cbff7ca6e5def69ca7bfbf6aa0
treea391b1eee7f097625a474ac1d31c9016cf513d39
parent628149b22761fd2bff7b81bda18fcc50bc11529c
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)).
include/i3status.h
src/print_cpu_temperature.c