Hello, guest. We have noticed that you are not registered at this bug tracker. Your experience will be greatly enhanced if you log in. To do so, you first must register by clicking on the Register tab at the top. If you are already registered, you can login at the Login tab.
Syndicate Syndicate Listing Display Search Login/Register
Bug Id ?
Reporter ?
Product/Version ?
HardInfo / 0.5.1
Status ?
Severity ?
Duplicate Of ?
- none -
Summary ?
Battery information triggers error message on standard error
Report Time ?
December 30, 2011 03:20:40 PM
Assignment ?
- none -
Resolution ?
Priority ?
Dependencies ?
- none -

For: 0 (0%)
Against: 0 (0%)
Total: 0

December 30, 2011 03:20:40 PM Göran Uddeborg
I noticed that whenever start hardinfo from an xterm and click on the "battery" entry in hardinfo, I got the error message

sh: -c: option requires an argument

in the terminal where I started hardinfo. I took a little look in the code and believe this comes from the function __scan_battery_apcupsd(void) in arch/linux/x86_64/battery.h (and most or all other arch/linux/*/battery.h). It contains this code

apcaccess_path = find_program("apcaccess");

if ((apcaccess = popen(apcaccess_path, "r"))) {

If the system doesn't have apcaccess installed, find_program() will return NULL. But the popen() regardless, and when apcaccess_path is null, it will cause the error message. I would suggest you add a "if (apcaccess_path == NULL) return" in between the above lines. Or some similar change with the same effect.

December 30, 2011 09:38:38 PM Leandro Pereira
Thanks for the bug report. Fixed in commit 9bf0c669435d6d307d4d678e80bd01736705bdb8.