X-Git-Url: https://git.octo.it/?a=blobdiff_plain;f=src%2Finterface.c;h=741ff764bd576f4ee45f5ea2d5ffb0cea14c8477;hb=1297a3723f6c5a79e8148e56c249a1aa7d3c6f35;hp=c439ebd60e8625b1bae55ea63b7dd479e018eb70;hpb=5afa2f82d43e2a7952d8f347f6f40b5778c59db8;p=collectd.git diff --git a/src/interface.c b/src/interface.c index c439ebd6..741ff764 100644 --- a/src/interface.c +++ b/src/interface.c @@ -58,10 +58,8 @@ # endif /* !COLLECT_GETIFADDRS */ #endif /* KERNEL_LINUX */ -#if HAVE_GETIFADDRS || KERNEL_LINUX || HAVE_LIBKSTAT || HAVE_LIBSTATGRAB -# define INTERFACE_HAVE_READ 1 -#else -# define INTERFACE_HAVE_READ 0 +#if !HAVE_GETIFADDRS && !KERNEL_LINUX && !HAVE_LIBKSTAT && !HAVE_LIBSTATGRAB +# error "No applicable input method." #endif /* @@ -132,7 +130,6 @@ static int interface_config (const char *key, const char *value) #if HAVE_LIBKSTAT static int interface_init (void) { -#if HAVE_LIBKSTAT kstat_t *ksp_chain; unsigned long long val; @@ -155,7 +152,6 @@ static int interface_init (void) continue; ksp[numif++] = ksp_chain; } -#endif /* HAVE_LIBKSTAT */ return (0); } /* int interface_init */ @@ -181,7 +177,6 @@ static int check_ignore_if (const char *interface) return (1 - if_list_action); } /* int check_ignore_if */ -#if INTERFACE_HAVE_READ static void if_submit (const char *dev, const char *type, unsigned long long rx, unsigned long long tx) @@ -317,7 +312,7 @@ static int interface_read (void) unsigned long long tx; if (kc == NULL) - return; + return (-1); for (i = 0; i < numif; i++) { @@ -353,7 +348,6 @@ static int interface_read (void) return (0); } /* int interface_read */ -#endif /* INTERFACE_HAVE_READ */ void module_register (void) { @@ -362,7 +356,5 @@ void module_register (void) #if HAVE_LIBKSTAT plugin_register_init ("interface", interface_init); #endif -#if INTERFACE_HAVE_READ plugin_register_read ("interface", interface_read); -#endif } /* void module_register */