From: Pavel Rochnyack Date: Sun, 20 May 2018 19:35:44 +0000 (+0700) Subject: Added missing include of 'kstat.h' and variable declaration X-Git-Url: https://git.octo.it/?p=collectd.git;a=commitdiff_plain;h=443be7f787ad39a38ea15eed5babe24c03e5f0b6 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' --- 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)