X-Git-Url: https://git.octo.it/?a=blobdiff_plain;f=src%2Ftape.c;h=ccf88255c0110e7a1d47e10febc28b0fb05d0e65;hb=25824c65721f0f21cadf1607fad367c7e7831816;hp=3f4bb55b5d1b3113677dcd21dbf80debc0428ab6;hpb=edcf39cc377d2de0744412209de4eeb50ca7ed5f;p=collectd.git diff --git a/src/tape.c b/src/tape.c index 3f4bb55b..ccf88255 100644 --- a/src/tape.c +++ b/src/tape.c @@ -22,17 +22,21 @@ #include "collectd.h" -#include "common.h" #include "plugin.h" +#include "utils/common/common.h" #if !HAVE_LIBKSTAT #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]; -static int numtape = 0; +static int numtape; static int tape_init(void) { kstat_t *ksp_chain; @@ -40,7 +44,7 @@ static int tape_init(void) { numtape = 0; if (kc == NULL) - return (-1); + return -1; for (numtape = 0, ksp_chain = kc->kc_chain; (numtape < MAX_NUMTAPE) && (ksp_chain != NULL); @@ -52,7 +56,7 @@ static int tape_init(void) { ksp[numtape++] = ksp_chain; } - return (0); + return 0; } /* int tape_init */ static void tape_submit(const char *plugin_instance, const char *type, @@ -94,10 +98,10 @@ static int tape_read(void) { static kstat_io_t kio; if (kc == NULL) - return (-1); + return -1; if (numtape <= 0) - return (-1); + return -1; for (int i = 0; i < numtape; i++) { if (kstat_read(kc, ksp[i], &kio) == -1) @@ -112,7 +116,7 @@ static int tape_read(void) { } } - return (0); + return 0; } void module_register(void) {