summaryrefslogtreecommitdiff
path: root/src/output.c
diff options
context:
space:
mode:
authorMichael Stapelberg <michael@stapelberg.de>2009-07-21 20:23:08 +0200
committerMichael Stapelberg <michael@stapelberg.de>2009-07-21 20:23:08 +0200
commit34ba9fa9083c655e5ba06cecd46da157eb07d980 (patch)
tree0e0674306ce5aab0c4bb9058c417b0b1197369fe /src/output.c
parent6fda988f360b3145d5772b6964f336dd652357ea (diff)
Correctly handle the order of items
Diffstat (limited to 'src/output.c')
-rw-r--r--src/output.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/src/output.c b/src/output.c
index 379710e..7fc24f5 100644
--- a/src/output.c
+++ b/src/output.c
@@ -103,19 +103,20 @@ void setup(void) {
/* Wait until wmii_path/rbar exists */
for (; stat(wmii_path, &statbuf) < 0; sleep(interval));
#endif
+#define cf(orderidx, name) create_file(order_to_str(order[orderidx], name));
cleanup_rbar_dir();
if (wlan_interface)
- create_file(concat(order[ORDER_WLAN],"wlan"));
+ cf(ORDER_WLAN, "wlan");
if (eth_interface)
- create_file(concat(order[ORDER_ETH],"eth"));
+ cf(ORDER_ETH, "eth");
if (get_cpu_temperature)
- create_file(concat(order[ORDER_CPU_TEMPERATURE], "cpu_temperature"));
- create_file(concat(order[ORDER_LOAD],"load"));
+ cf(ORDER_CPU_TEMPERATURE, "cpu_temperature");
+ cf(ORDER_LOAD, "load");
if (time_format)
- create_file(concat(order[ORDER_TIME],"time"));
+ cf(ORDER_TIME, "time");
for (i = 0; i < num_run_watches; i += 2) {
- snprintf(pathbuf, sizeof(pathbuf), "%s%s", order[ORDER_RUN], run_watches[i]);
+ snprintf(pathbuf, sizeof(pathbuf), "%d%s", order[ORDER_RUN], run_watches[i]);
create_file(pathbuf);
}
}