From a86361510c10ac5f19e2959d33e9ffb7f6c5099e Mon Sep 17 00:00:00 2001 From: Michael Stapelberg Date: Thu, 23 Jul 2009 18:40:49 +0200 Subject: Implement battery status and thermal zones for FreeBSD (patch by Baptiste Daroussin) --- src/config.c | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) (limited to 'src/config.c') diff --git a/src/config.c b/src/config.c index 8fff8d0..2d9d6b6 100644 --- a/src/config.c +++ b/src/config.c @@ -69,13 +69,11 @@ int load_configuration(const char *configfile) { get_ethspeed = true; OPT("get_cpu_temperature") { get_cpu_temperature = true; - if (strlen(dest_value) > 0) { - if (asprintf(&thermal_zone, "/sys/class/thermal/thermal_zone%d/temp", atoi(dest_value)) == -1) - die("Could not build thermal_zone path\n"); - } else { - if (asprintf(&thermal_zone, "/sys/class/thermal/thermal_zone0/temp") == -1) - die("Could not build thermal_zone path\n"); - } + int zone = 0; + if (strlen(dest_value) > 0) + zone = atoi(dest_value); + if (asprintf(&thermal_zone, THERMAL_ZONE, zone) == -1) + die("Could not build thermal_zone path\n"); } OPT("normcolors") wmii_normcolors = strdup(dest_value); OPT("interval") -- cgit v1.2.3