]> git.ipfire.org Git - thirdparty/collectd.git/commitdiff
Include kstat.h if available to provide kstat_ctl_t
authorDagobert Michelsen <dam@opencsw.org>
Sat, 10 Mar 2018 17:34:33 +0000 (18:34 +0100)
committerDagobert Michelsen <dam@opencsw.org>
Sat, 10 Mar 2018 17:34:33 +0000 (18:34 +0100)
13 files changed:
src/cpu.c
src/daemon/collectd.c
src/daemon/common.c
src/daemon/common_test.c
src/daemon/plugin_mock.c
src/daemon/utils_subst_test.c
src/disk.c
src/interface.c
src/tape.c
src/uptime.c
src/utils_mount_test.c
src/utils_vl_lookup.c
src/zfs_arc.c

index 0bf38e7f661ba548ae3a4c5dd7e6419f53972e10..8480f11a624e3e83298066567f308d172f3ef0cf 100644 (file)
--- 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 <kstat.h>
+#endif
 /* colleague tells me that Sun doesn't sell systems with more than 100 or so
  * CPUs.. */
 #define MAX_NUMCPU 256
index d6060a1a2a788c2d0a7f2a10c91bec222974dfbb..727876bc2f0fd4fb11caa245c226cb42e25f4bdf 100644 (file)
 #include <statgrab.h>
 #endif
 
+#if HAVE_KSTAT_H
+#include <kstat.h>
+#endif
+
 #ifndef COLLECTD_LOCALE
 #define COLLECTD_LOCALE "C"
 #endif
@@ -201,6 +205,7 @@ static int change_basedir(const char *orig_dir, _Bool create) {
 } /* static int change_basedir (char *dir) */
 
 #if HAVE_LIBKSTAT
+extern kstat_ctl_t *kc;
 static void update_kstat(void) {
   if (kc == NULL) {
     if ((kc = kstat_open()) == NULL)
index bf833ee8188864632d79fecd8e64f0fa4ecdf388..fbbb6085aafa80341b48b443362fbb5ad14ed0ea 100644 (file)
 #include <sys/capability.h>
 #endif
 
+#if HAVE_KSTAT_H
+#include <kstat.h>
+#endif
+
 #ifdef HAVE_LIBKSTAT
 extern kstat_ctl_t *kc;
 #endif
index 4d2ccaa338d22b31a76d599a94c610b267f5263f..af2840e5883147d474b8bb3b316515b86a6cd408 100644 (file)
 #include "common.h"
 #include "testing.h"
 
+#if HAVE_KSTAT_H
+#include <kstat.h>
+#endif
+
 #if HAVE_LIBKSTAT
 kstat_ctl_t *kc;
 #endif /* HAVE_LIBKSTAT */
index 6df4c15df691b2c3c162ff6e2c39d76637aa2cb4..96bf3826f3e17254dda3da65eb90e1030a930421 100644 (file)
 
 #include "plugin.h"
 
+#if HAVE_KSTAT_H
+#include <kstat.h>
+#endif
+
 #if HAVE_LIBKSTAT
 kstat_ctl_t *kc = NULL;
 #endif /* HAVE_LIBKSTAT */
index 00ea0eae2d81ea61cae355c20c004c83d13c73be..537921910fd0b50c76ef1d53ab20ab191aaebbcc 100644 (file)
 #include "testing.h"
 #include "utils_subst.h"
 
+#if HAVE_KSTAT_H
+#include <kstat.h>
+#endif
+
 #if HAVE_LIBKSTAT
 kstat_ctl_t *kc;
 #endif /* HAVE_LIBKSTAT */
index 004ce9e2d7415b39254f7f39991821a6d7b45fbb..45706bc262044855d58cbf49464ded2c1ea10366 100644 (file)
@@ -120,6 +120,9 @@ static struct gmesh geom_tree;
 /* #endif KERNEL_FREEBSD */
 
 #elif HAVE_LIBKSTAT
+#if HAVE_KSTAT_H
+#include <kstat.h>
+#endif
 #define MAX_NUMDISK 1024
 extern kstat_ctl_t *kc;
 static kstat_t *ksp[MAX_NUMDISK];
index 6c80334e681a63e4d3825df39d05a3a5d8686cec..c45ef6603b79c51e1cbfdc4f7aa04ea9dc7d0e52 100644 (file)
@@ -91,6 +91,9 @@ static ignorelist_t *ignorelist = NULL;
 static _Bool report_inactive = 1;
 
 #ifdef HAVE_LIBKSTAT
+#if HAVE_KSTAT_H
+#include <kstat.h>
+#endif
 #define MAX_NUMIF 256
 extern kstat_ctl_t *kc;
 static kstat_t *ksp[MAX_NUMIF];
index debb1d28a52beb12b43f1940c7a49569d9e2f7b7..f59b7ea6b3860dc3892269b4455e398f31943323 100644 (file)
 #error "No applicable input method."
 #endif
 
+#if HAVE_KSTAT_H
+#include <kstat.h>
+#endif
+
 #define MAX_NUMTAPE 256
 extern kstat_ctl_t *kc;
 static kstat_t *ksp[MAX_NUMTAPE];
index 31a2c1e20d03d76105f24189fef4ec8372c6d878..43d72e53d35fe1f8bc411e01bcba15f68629d49a 100644 (file)
  * Global variables
  */
 
+#if HAVE_KSTAT_H
+#include <kstat.h>
+#endif
+
 #if HAVE_LIBKSTAT
 extern kstat_ctl_t *kc;
 #endif /* #endif HAVE_LIBKSTAT */
index ca65950ebffee08828b20d85a409debef23e28bc..e8f3009423706622988853b351932d730941d463 100644 (file)
 #include "testing.h"
 #include "utils_mount.h"
 
+#if HAVE_KSTAT_H
+#include <kstat.h>
+#endif
+
 #if HAVE_LIBKSTAT
 kstat_ctl_t *kc;
 #endif /* HAVE_LIBKSTAT */
index 76c0674b8d596e6f0e28eb97830eef9a5a422465..052c4c0f83b630fd42dd6b64df5ff257d22737a2 100644 (file)
 #include "utils_avltree.h"
 #include "utils_vl_lookup.h"
 
+#if HAVE_KSTAT_H
+#include <kstat.h>
+#endif
+
 #if HAVE_LIBKSTAT
 kstat_ctl_t *kc;
 #endif /* HAVE_LIBKSTAT */
index af4bfccb467baf84cd48f27b25f92e52d875972f..c9abdd5f03c008914a4bd5d5283bd6d06b9db5b3 100644 (file)
@@ -99,6 +99,11 @@ static void free_zfs_values(kstat_t *ksp) {
 }
 
 #elif defined(KERNEL_SOLARIS)
+
+#if HAVE_KSTAT_H
+#include <kstat.h>
+#endif
+
 extern kstat_ctl_t *kc;
 
 static long long get_zfs_value(kstat_t *ksp, char *name) {