diff options
author | Leandro A. F. Pereira <leandro@hardinfo.org> | 2009-02-21 14:14:32 -0300 |
---|---|---|
committer | Leandro A. F. Pereira <leandro@hardinfo.org> | 2009-02-21 14:14:32 -0300 |
commit | 5be48c1fcba0d3526fe6e1940b2120e83970a7da (patch) | |
tree | d64de3405e8539c65b4c810aea3795ac9d140075 /hardinfo2/arch | |
parent | 6bc92795d0855cc08cf93e00a13f11595d36c7ec (diff) |
Use find_program() for apcaccess too.
Diffstat (limited to 'hardinfo2/arch')
-rw-r--r-- | hardinfo2/arch/linux/common/battery.h | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/hardinfo2/arch/linux/common/battery.h b/hardinfo2/arch/linux/common/battery.h index f4cf46dc..683cf01d 100644 --- a/hardinfo2/arch/linux/common/battery.h +++ b/hardinfo2/arch/linux/common/battery.h @@ -56,10 +56,12 @@ __scan_battery_apcupsd(void) { GHashTable *ups_data; FILE *apcaccess; - char buffer[512]; + char buffer[512], *apcaccess_path; int i; - if ((apcaccess = popen("apcaccess", "r"))) { + apcaccess_path = find_program("apcaccess"); + + if ((apcaccess = popen(apcaccess_path, "r"))) { /* first line isn't important */ if (fgets(buffer, 512, apcaccess)) { /* allocate the key, value hash table */ @@ -92,6 +94,8 @@ __scan_battery_apcupsd(void) pclose(apcaccess); } + + g_free(apcaccess_path); } static void |