diff options
author | Michael Stapelberg <michael@stapelberg.de> | 2009-07-23 18:40:49 +0200 |
---|---|---|
committer | Michael Stapelberg <michael@stapelberg.de> | 2009-07-23 18:40:49 +0200 |
commit | a86361510c10ac5f19e2959d33e9ffb7f6c5099e (patch) | |
tree | 4b606ef03e6065f4d0eacdeed8ecac165d3f7ee1 /src/config.c | |
parent | 3de290742744de5f08be17d14f1dce377815e3f4 (diff) |
Implement battery status and thermal zones for FreeBSD (patch by Baptiste Daroussin)
Diffstat (limited to 'src/config.c')
-rw-r--r-- | src/config.c | 12 |
1 files changed, 5 insertions, 7 deletions
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") |