X-Git-Url: https://git.octo.it/?a=blobdiff_plain;f=src%2Finterface.c;h=849de955ed1be50916a880c694f6eb6a5a21dbe1;hb=f7649ae4a3270efe73f55bd00ca7fb89f269b8ec;hp=a74699ee85d18b9688b2716fc448e86e3ffbbc75;hpb=6159b6f81403b90eb2b1f1c60fa8006cd3405d1b;p=collectd.git diff --git a/src/interface.c b/src/interface.c index a74699ee..849de955 100644 --- a/src/interface.c +++ b/src/interface.c @@ -26,7 +26,6 @@ #include "common.h" #include "plugin.h" -#include "configfile.h" #include "utils_ignorelist.h" #if HAVE_SYS_TYPES_H @@ -169,17 +168,17 @@ static void if_submit (const char *dev, const char *type, derive_t rx, derive_t tx) { - value_t values[2]; value_list_t vl = VALUE_LIST_INIT; + value_t values[] = { + { .derive = rx }, + { .derive = tx }, + }; if (ignorelist_match (ignorelist, dev) != 0) return; - values[0].derive = rx; - values[1].derive = tx; - vl.values = values; - vl.values_len = 2; + vl.values_len = STATIC_ARRAY_SIZE (values); sstrncpy (vl.host, hostname_g, sizeof (vl.host)); sstrncpy (vl.plugin, "interface", sizeof (vl.plugin)); sstrncpy (vl.plugin_instance, dev, sizeof (vl.plugin_instance));