From 18bd5ab738b3746e39a95d2def13903f04e2386b Mon Sep 17 00:00:00 2001 From: Pavel Rochnyack Date: Mon, 21 May 2018 00:52:33 +0700 Subject: [PATCH] Added missing include of 'kstat.h' This adressed to solve compilation issue on Solaris platform: src/utils_vl_lookup.c:37:1: error: unknown type name 'kstat_ctl_t' kstat_ctl_t *kc; --- src/cpu.c | 3 +++ src/daemon/common_test.c | 4 ++++ src/daemon/plugin_mock.c | 4 ++++ src/daemon/utils_subst_test.c | 4 ++++ src/disk.c | 3 +++ src/interface.c | 3 +++ src/tape.c | 4 ++++ src/uptime.c | 3 +++ src/utils_mount_test.c | 4 ++++ src/utils_vl_lookup.c | 4 ++++ src/zfs_arc.c | 5 +++++ 11 files changed, 41 insertions(+) diff --git a/src/cpu.c b/src/cpu.c index d48ab886..b898477f 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 diff --git a/src/daemon/common_test.c b/src/daemon/common_test.c index 4d2ccaa3..af2840e5 100644 --- a/src/daemon/common_test.c +++ b/src/daemon/common_test.c @@ -27,6 +27,10 @@ #include "common.h" #include "testing.h" +#if HAVE_KSTAT_H +#include +#endif + #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 6df4c15d..96bf3826 100644 --- a/src/daemon/plugin_mock.c +++ b/src/daemon/plugin_mock.c @@ -26,6 +26,10 @@ #include "plugin.h" +#if HAVE_KSTAT_H +#include +#endif + #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 00ea0eae..53792191 100644 --- 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" +#if HAVE_KSTAT_H +#include +#endif + #if HAVE_LIBKSTAT kstat_ctl_t *kc; #endif /* HAVE_LIBKSTAT */ diff --git a/src/disk.c b/src/disk.c index 51a50fd1..205d547b 100644 --- a/src/disk.c +++ b/src/disk.c @@ -120,6 +120,9 @@ static struct gmesh geom_tree; /* #endif KERNEL_FREEBSD */ #elif HAVE_LIBKSTAT +#if HAVE_KSTAT_H +#include +#endif #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 deba1860..3a3e9f6e 100644 --- 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 +#if HAVE_KSTAT_H +#include +#endif #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 debb1d28..f59b7ea6 100644 --- a/src/tape.c +++ b/src/tape.c @@ -29,6 +29,10 @@ #error "No applicable input method." #endif +#if HAVE_KSTAT_H +#include +#endif + #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 d51aa391..76eb0d50 100644 --- a/src/uptime.c +++ b/src/uptime.c @@ -52,6 +52,9 @@ /* * Global variables */ +#if HAVE_KSTAT_H +#include +#endif #if HAVE_LIBKSTAT extern kstat_ctl_t *kc; diff --git a/src/utils_mount_test.c b/src/utils_mount_test.c index ca65950e..e8f30094 100644 --- a/src/utils_mount_test.c +++ b/src/utils_mount_test.c @@ -30,6 +30,10 @@ #include "testing.h" #include "utils_mount.h" +#if HAVE_KSTAT_H +#include +#endif + #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 76c0674b..052c4c0f 100644 --- 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" +#if HAVE_KSTAT_H +#include +#endif + #if HAVE_LIBKSTAT kstat_ctl_t *kc; #endif /* HAVE_LIBKSTAT */ diff --git a/src/zfs_arc.c b/src/zfs_arc.c index 5d37f9f1..55166fa6 100644 --- 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) + +#if HAVE_KSTAT_H +#include +#endif + extern kstat_ctl_t *kc; static long long get_zfs_value(kstat_t *ksp, char *name) { -- 2.11.0