]> git.sur5r.net Git - i3/i3status/blobdiff - src/print_cpu_usage.c
fix: use SYSCONFDIR in error message
[i3/i3status] / src / print_cpu_usage.c
index faac920a6086e415b39773e4865e6c860c695002..a5021bfcbbb85afe724a8eec6fa9401fad86c377 100644 (file)
@@ -1,5 +1,8 @@
 // vim:ts=4:sw=4:expandtab
+#include <config.h>
+#if defined(__linux__)
 #include <sys/sysinfo.h>
+#endif
 #include <stdlib.h>
 #include <limits.h>
 #include <stdio.h>
@@ -60,7 +63,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 +164,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);