diff options
author | Michael Stapelberg <stapelberg@users.noreply.github.com> | 2015-03-25 08:56:00 +0100 |
---|---|---|
committer | Michael Stapelberg <stapelberg@users.noreply.github.com> | 2015-03-25 08:56:00 +0100 |
commit | be583ea739fd2412138c1d73a01ca4a5ca4e9252 (patch) | |
tree | ce0a76d9f000ef1cd13eadb5ae2f126174846e6a /src/print_cpu_usage.c | |
parent | bf223d9b61498a6b1e723bacb007545a696141fe (diff) | |
parent | c9dc67e0542a0f540b014e8b2607bfc269433951 (diff) |
Merge pull request #13 from bapt/master
Fixes for FreeBSD
Diffstat (limited to 'src/print_cpu_usage.c')
-rw-r--r-- | src/print_cpu_usage.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/print_cpu_usage.c b/src/print_cpu_usage.c index 68437b3..2c59f69 100644 --- a/src/print_cpu_usage.c +++ b/src/print_cpu_usage.c @@ -40,12 +40,12 @@ static int prev_idle = 0; void print_cpu_usage(yajl_gen json_gen, char *buffer, const char *format) { const char *walk; char *outwalk = buffer; - char buf[1024]; int curr_user = 0, curr_nice = 0, curr_system = 0, curr_idle = 0, curr_total; int diff_idle, diff_total, diff_usage; #if defined(LINUX) static char statpath[512]; + char buf[1024]; strcpy(statpath, "/proc/stat"); if (!slurp(statpath, buf, sizeof(buf)) || sscanf(buf, "cpu %d %d %d %d", &curr_user, &curr_nice, &curr_system, &curr_idle) != 4) |