summaryrefslogtreecommitdiff
path: root/src/print_cpu_usage.c
diff options
context:
space:
mode:
authorMichael Stapelberg <stapelberg@users.noreply.github.com>2019-01-23 08:56:40 +0100
committerGitHub <noreply@github.com>2019-01-23 08:56:40 +0100
commita57cdc84e2f38ea99fd464d8b5b6446c769cc545 (patch)
tree48ba736e56b8212d2c3e47cce83864d798e2fa46 /src/print_cpu_usage.c
parent7efbeeaf6ce9232f7479f76c1c79ff73c0db49e4 (diff)
Switch to autotools (#316)
Diffstat (limited to 'src/print_cpu_usage.c')
-rw-r--r--src/print_cpu_usage.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/print_cpu_usage.c b/src/print_cpu_usage.c
index faac920..3c3c0d5 100644
--- a/src/print_cpu_usage.c
+++ b/src/print_cpu_usage.c
@@ -1,4 +1,5 @@
// vim:ts=4:sw=4:expandtab
+#include <config.h>
#include <sys/sysinfo.h>
#include <stdlib.h>
#include <limits.h>
@@ -60,7 +61,7 @@ void print_cpu_usage(yajl_gen json_gen, char *buffer, const char *format, const
int diff_idle, diff_total, diff_usage;
bool colorful_output = false;
-#if defined(LINUX)
+#if defined(__linux__)
// Detecting if CPU count has changed
int curr_cpu_count = get_nprocs_conf();
@@ -161,7 +162,7 @@ void print_cpu_usage(yajl_gen json_gen, char *buffer, const char *format, const
outwalk += sprintf(outwalk, "%02d%s", diff_usage, pct_mark);
walk += strlen("usage");
}
-#if defined(LINUX)
+#if defined(__linux__)
else if (BEGINS_WITH(walk + 1, "cpu")) {
int number = -1;
sscanf(walk + 1, "cpu%d", &number);