projects
/
collectd.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
279c8b3
)
Include kstat.h if available to provide kstat_ctl_t
author
Dagobert Michelsen
<dam@opencsw.org>
Sat, 10 Mar 2018 17:34:33 +0000
(18:34 +0100)
committer
Dagobert Michelsen
<dam@opencsw.org>
Sat, 10 Mar 2018 17:34:33 +0000
(18:34 +0100)
13 files changed:
src/cpu.c
patch
|
blob
|
history
src/daemon/collectd.c
patch
|
blob
|
history
src/daemon/common.c
patch
|
blob
|
history
src/daemon/common_test.c
patch
|
blob
|
history
src/daemon/plugin_mock.c
patch
|
blob
|
history
src/daemon/utils_subst_test.c
patch
|
blob
|
history
src/disk.c
patch
|
blob
|
history
src/interface.c
patch
|
blob
|
history
src/tape.c
patch
|
blob
|
history
src/uptime.c
patch
|
blob
|
history
src/utils_mount_test.c
patch
|
blob
|
history
src/utils_vl_lookup.c
patch
|
blob
|
history
src/zfs_arc.c
patch
|
blob
|
history
diff --git
a/src/cpu.c
b/src/cpu.c
index
0bf38e7
..
8480f11
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)
/* #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
/* colleague tells me that Sun doesn't sell systems with more than 100 or so
* CPUs.. */
#define MAX_NUMCPU 256
diff --git
a/src/daemon/collectd.c
b/src/daemon/collectd.c
index
d6060a1
..
727876b
100644
(file)
--- a/
src/daemon/collectd.c
+++ b/
src/daemon/collectd.c
@@
-43,6
+43,10
@@
#include <statgrab.h>
#endif
#include <statgrab.h>
#endif
+#if HAVE_KSTAT_H
+#include <kstat.h>
+#endif
+
#ifndef COLLECTD_LOCALE
#define COLLECTD_LOCALE "C"
#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
} /* 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)
static void update_kstat(void) {
if (kc == NULL) {
if ((kc = kstat_open()) == NULL)
diff --git
a/src/daemon/common.c
b/src/daemon/common.c
index
bf833ee
..
fbbb608
100644
(file)
--- a/
src/daemon/common.c
+++ b/
src/daemon/common.c
@@
-60,6
+60,10
@@
#include <sys/capability.h>
#endif
#include <sys/capability.h>
#endif
+#if HAVE_KSTAT_H
+#include <kstat.h>
+#endif
+
#ifdef HAVE_LIBKSTAT
extern kstat_ctl_t *kc;
#endif
#ifdef HAVE_LIBKSTAT
extern kstat_ctl_t *kc;
#endif
diff --git
a/src/daemon/common_test.c
b/src/daemon/common_test.c
index
4d2ccaa
..
af2840e
100644
(file)
--- a/
src/daemon/common_test.c
+++ b/
src/daemon/common_test.c
@@
-27,6
+27,10
@@
#include "common.h"
#include "testing.h"
#include "common.h"
#include "testing.h"
+#if HAVE_KSTAT_H
+#include <kstat.h>
+#endif
+
#if HAVE_LIBKSTAT
kstat_ctl_t *kc;
#endif /* HAVE_LIBKSTAT */
#if HAVE_LIBKSTAT
kstat_ctl_t *kc;
#endif /* HAVE_LIBKSTAT */
diff --git
a/src/daemon/plugin_mock.c
b/src/daemon/plugin_mock.c
index
6df4c15
..
96bf382
100644
(file)
--- a/
src/daemon/plugin_mock.c
+++ b/
src/daemon/plugin_mock.c
@@
-26,6
+26,10
@@
#include "plugin.h"
#include "plugin.h"
+#if HAVE_KSTAT_H
+#include <kstat.h>
+#endif
+
#if HAVE_LIBKSTAT
kstat_ctl_t *kc = NULL;
#endif /* HAVE_LIBKSTAT */
#if HAVE_LIBKSTAT
kstat_ctl_t *kc = NULL;
#endif /* HAVE_LIBKSTAT */
diff --git
a/src/daemon/utils_subst_test.c
b/src/daemon/utils_subst_test.c
index
00ea0ea
..
5379219
100644
(file)
--- a/
src/daemon/utils_subst_test.c
+++ b/
src/daemon/utils_subst_test.c
@@
-30,6
+30,10
@@
#include "testing.h"
#include "utils_subst.h"
#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 */
#if HAVE_LIBKSTAT
kstat_ctl_t *kc;
#endif /* HAVE_LIBKSTAT */
diff --git
a/src/disk.c
b/src/disk.c
index
004ce9e
..
45706bc
100644
(file)
--- a/
src/disk.c
+++ b/
src/disk.c
@@
-120,6
+120,9
@@
static struct gmesh geom_tree;
/* #endif KERNEL_FREEBSD */
#elif HAVE_LIBKSTAT
/* #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];
#define MAX_NUMDISK 1024
extern kstat_ctl_t *kc;
static kstat_t *ksp[MAX_NUMDISK];
diff --git
a/src/interface.c
b/src/interface.c
index
6c80334
..
c45ef66
100644
(file)
--- a/
src/interface.c
+++ b/
src/interface.c
@@
-91,6
+91,9
@@
static ignorelist_t *ignorelist = NULL;
static _Bool report_inactive = 1;
#ifdef HAVE_LIBKSTAT
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];
#define MAX_NUMIF 256
extern kstat_ctl_t *kc;
static kstat_t *ksp[MAX_NUMIF];
diff --git
a/src/tape.c
b/src/tape.c
index
debb1d2
..
f59b7ea
100644
(file)
--- a/
src/tape.c
+++ b/
src/tape.c
@@
-29,6
+29,10
@@
#error "No applicable input method."
#endif
#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];
#define MAX_NUMTAPE 256
extern kstat_ctl_t *kc;
static kstat_t *ksp[MAX_NUMTAPE];
diff --git
a/src/uptime.c
b/src/uptime.c
index
31a2c1e
..
43d72e5
100644
(file)
--- a/
src/uptime.c
+++ b/
src/uptime.c
@@
-53,6
+53,10
@@
* Global variables
*/
* Global variables
*/
+#if HAVE_KSTAT_H
+#include <kstat.h>
+#endif
+
#if HAVE_LIBKSTAT
extern kstat_ctl_t *kc;
#endif /* #endif HAVE_LIBKSTAT */
#if HAVE_LIBKSTAT
extern kstat_ctl_t *kc;
#endif /* #endif HAVE_LIBKSTAT */
diff --git
a/src/utils_mount_test.c
b/src/utils_mount_test.c
index
ca65950
..
e8f3009
100644
(file)
--- a/
src/utils_mount_test.c
+++ b/
src/utils_mount_test.c
@@
-30,6
+30,10
@@
#include "testing.h"
#include "utils_mount.h"
#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 */
#if HAVE_LIBKSTAT
kstat_ctl_t *kc;
#endif /* HAVE_LIBKSTAT */
diff --git
a/src/utils_vl_lookup.c
b/src/utils_vl_lookup.c
index
76c0674
..
052c4c0
100644
(file)
--- a/
src/utils_vl_lookup.c
+++ b/
src/utils_vl_lookup.c
@@
-33,6
+33,10
@@
#include "utils_avltree.h"
#include "utils_vl_lookup.h"
#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 */
#if HAVE_LIBKSTAT
kstat_ctl_t *kc;
#endif /* HAVE_LIBKSTAT */
diff --git
a/src/zfs_arc.c
b/src/zfs_arc.c
index
af4bfcc
..
c9abdd5
100644
(file)
--- a/
src/zfs_arc.c
+++ b/
src/zfs_arc.c
@@
-99,6
+99,11
@@
static void free_zfs_values(kstat_t *ksp) {
}
#elif defined(KERNEL_SOLARIS)
}
#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) {
extern kstat_ctl_t *kc;
static long long get_zfs_value(kstat_t *ksp, char *name) {