From 443be7f787ad39a38ea15eed5babe24c03e5f0b6 Mon Sep 17 00:00:00 2001 From: Pavel Rochnyack Date: Mon, 21 May 2018 02:35:44 +0700 Subject: [PATCH] Added missing include of 'kstat.h' and variable declaration This adressed to solve compilation issue on Solaris platform: src/daemon/collectd.c:212: error: 'kc' undeclared (first use in this function) src/daemon/collectd.c:213: error: implicit declaration of function 'kstat_open' --- src/daemon/collectd.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/daemon/collectd.c b/src/daemon/collectd.c index 9ec09347..7dba657d 100644 --- a/src/daemon/collectd.c +++ b/src/daemon/collectd.c @@ -43,6 +43,10 @@ #include #endif +#if HAVE_KSTAT_H +#include +#endif + #ifndef COLLECTD_LOCALE #define COLLECTD_LOCALE "C" #endif @@ -208,6 +212,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) -- 2.11.0