X-Git-Url: https://git.octo.it/?a=blobdiff_plain;f=src%2Finterface.c;h=b7c6f90e13f084d424715eb607786c05bcf4db1e;hb=38f1d841840096c00a3d0b57bc2c86b6a256f303;hp=b8cc48da2a5b7ca7678160e8ae8e9fa7ff8bafa8;hpb=79963d13c1884d1d92667cc502ad20758b084a12;p=collectd.git diff --git a/src/interface.c b/src/interface.c index b8cc48da..b7c6f90e 100644 --- a/src/interface.c +++ b/src/interface.c @@ -155,18 +155,16 @@ static int interface_init(void) { 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; - sstrncpy(vl.host, hostname_g, sizeof(vl.host)); + vl.values_len = STATIC_ARRAY_SIZE(values); sstrncpy(vl.plugin, "interface", sizeof(vl.plugin)); sstrncpy(vl.plugin_instance, dev, sizeof(vl.plugin_instance)); sstrncpy(vl.type, type, sizeof(vl.type));