X-Git-Url: https://git.octo.it/?a=blobdiff_plain;f=src%2Fcpu.c;h=6db8629377dc99faacadac4927aa9f8f230f861a;hb=4e89060ceb1a14ec7f9abfe9caa6b0da7e76bd5c;hp=0bf38e7f661ba548ae3a4c5dd7e6419f53972e10;hpb=084761bb8a360ac0f9e21ad43c82312676cc4a37;p=collectd.git diff --git a/src/cpu.c b/src/cpu.c index 0bf38e7f..6db86293 100644 --- a/src/cpu.c +++ b/src/cpu.c @@ -134,6 +134,9 @@ static mach_msg_type_number_t cpu_list_len; /* #endif KERNEL_LINUX */ #elif defined(HAVE_LIBKSTAT) +#if HAVE_KSTAT_H +#include +#endif /* colleague tells me that Sun doesn't sell systems with more than 100 or so * CPUs.. */ #define MAX_NUMCPU 256 @@ -180,7 +183,7 @@ static int pnumcpu; struct cpu_state_s { value_to_rate_state_t conv; gauge_t rate; - _Bool has_value; + bool has_value; }; typedef struct cpu_state_s cpu_state_t; @@ -191,12 +194,12 @@ static size_t cpu_states_num = 0; /* #cpu_states allocated */ * determine how many CPUs there were. Reset to 0 by cpu_reset(). */ static size_t global_cpu_num = 0; -static _Bool report_by_cpu = 1; -static _Bool report_by_state = 1; -static _Bool report_percent = 0; -static _Bool report_num_cpu = 0; -static _Bool report_guest = 0; -static _Bool subtract_guest = 1; +static bool report_by_cpu = true; +static bool report_by_state = true; +static bool report_percent; +static bool report_num_cpu; +static bool report_guest; +static bool subtract_guest = true; static const char *config_keys[] = {"ReportByCpu", "ReportByState", "ReportNumCpu", "ValuesPercentage",