From 5be48c1fcba0d3526fe6e1940b2120e83970a7da Mon Sep 17 00:00:00 2001 From: "Leandro A. F. Pereira" Date: Sat, 21 Feb 2009 14:14:32 -0300 Subject: Use find_program() for apcaccess too. --- hardinfo2/arch/linux/common/battery.h | 8 ++++++-- hardinfo2/pixmaps/network-statistics.png | Bin 1011 -> 1163 bytes 2 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 diff --git a/hardinfo2/pixmaps/network-statistics.png b/hardinfo2/pixmaps/network-statistics.png index c82d574f..18a118a2 100644 Binary files a/hardinfo2/pixmaps/network-statistics.png and b/hardinfo2/pixmaps/network-statistics.png differ -- cgit v1.2.3