From: Sebastian Harl Date: Mon, 5 Feb 2007 21:42:26 +0000 (+0100) Subject: processes.c, utils_dns.c: Fix compile errors on GNU/kFreeBSD. X-Git-Tag: collectd-3.11.1~5^2^2~1 X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=217ab3ec487b9dfdd09ef04cd42d28b421e266ce;p=collectd.git processes.c, utils_dns.c: Fix compile errors on GNU/kFreeBSD. Signed-off-by: Sebastian Harl --- diff --git a/src/processes.c b/src/processes.c index c8f30168..68984458 100644 --- a/src/processes.c +++ b/src/processes.c @@ -144,12 +144,14 @@ static char *ps_pagefaults_ds_def[] = }; static int ps_pagefaults_ds_num = 2; +#if HAVE_THREAD_INFO | KERNEL_LINUX static char *config_keys[] = { "Process", NULL }; static int config_keys_num = 1; +#endif typedef struct procstat_entry_s { @@ -192,7 +194,9 @@ typedef struct procstat struct procstat_entry_s *instances; } procstat_t; +#if HAVE_THREAD_INFO | KERNEL_LINUX static procstat_t *list_head_g = NULL; +#endif #if HAVE_THREAD_INFO static mach_port_t port_host_self; @@ -403,7 +407,6 @@ static void ps_list_reset (void) } /* while (pse != NULL) */ } /* for (ps = list_head_g; ps != NULL; ps = ps->next) */ } -#endif /* HAVE_THREAD_INFO | KERNEL_LINUX */ static int ps_config (char *key, char *value) { @@ -418,6 +421,7 @@ static int ps_config (char *key, char *value) return (0); } +#endif /* HAVE_THREAD_INFO | KERNEL_LINUX */ static void ps_init (void) { @@ -1135,7 +1139,9 @@ void module_register (void) plugin_register ("ps_cputime", NULL, NULL, ps_cputime_write); plugin_register ("ps_count", NULL, NULL, ps_count_write); plugin_register ("ps_pagefaults", NULL, NULL, ps_pagefaults_write); +#if HAVE_THREAD_INFO | KERNEL_LINUX cf_register (MODULE_NAME, ps_config, config_keys, config_keys_num); +#endif } #undef BUFSIZE diff --git a/src/utils_dns.c b/src/utils_dns.c index e9aec38f..89c03203 100644 --- a/src/utils_dns.c +++ b/src/utils_dns.c @@ -110,7 +110,7 @@ # define PPP_CONTROL_VAL 0x03 /* The control byte value */ #endif -#ifdef __linux__ +#ifndef __FAVOR_BSD #define uh_sport source #define uh_dport dest #endif