diff options
author | Michael Stapelberg <michael@stapelberg.de> | 2012-05-09 18:56:57 +0200 |
---|---|---|
committer | Michael Stapelberg <michael@stapelberg.de> | 2012-05-09 18:56:57 +0200 |
commit | 296eb5e7063b4051927f2e2bf94e1034bf64f60c (patch) | |
tree | 9d91807302af35783372848dbd028f21494c843e /src/print_cpu_usage.c | |
parent | 88b157cc8a19a312d93cba1f9332fc40b385e253 (diff) |
Error handling: Never output null as full_text (JSON), prefix messages with i3status (Thanks Artemis)
The former made i3bar crash, the latter is helpful for debugging.
Diffstat (limited to 'src/print_cpu_usage.c')
-rw-r--r-- | src/print_cpu_usage.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/print_cpu_usage.c b/src/print_cpu_usage.c index 7113eae..7820840 100644 --- a/src/print_cpu_usage.c +++ b/src/print_cpu_usage.c @@ -92,5 +92,6 @@ void print_cpu_usage(yajl_gen json_gen, char *buffer, const char *format) { OUTPUT_FULL_TEXT(buffer); return; error: - (void)fputs("Cannot read usage\n", stderr); + OUTPUT_FULL_TEXT("cant read cpu usage"); + (void)fputs("i3status: Cannot read CPU usage\n", stderr); } |