X-Git-Url: https://git.octo.it/?a=blobdiff_plain;f=src%2Fswap.c;h=403b148b3c2b8e38f15353251eccf86e44f46a83;hb=3a4ac4e07fd870d0fc026fadd25f5fe5e2dda598;hp=9c63e9bbb56ca82a7e4ce25de7219d79aa8040d2;hpb=5523a080010dcb7a61dc0dccc3969a2a048e52f9;p=collectd.git diff --git a/src/swap.c b/src/swap.c index 9c63e9bb..403b148b 100644 --- a/src/swap.c +++ b/src/swap.c @@ -194,12 +194,10 @@ static void swap_submit_usage (char const *plugin_instance, /* {{{ */ gauge_t used, gauge_t free, char const *other_name, gauge_t other_value) { - value_t v[1]; value_list_t vl = VALUE_LIST_INIT; - vl.values = v; - vl.values_len = STATIC_ARRAY_SIZE (v); - sstrncpy (vl.host, hostname_g, sizeof (vl.host)); + vl.values = &(value_t) { .gauge = NAN }; + vl.values_len = 1; sstrncpy (vl.plugin, "swap", sizeof (vl.plugin)); if (plugin_instance != NULL) sstrncpy (vl.plugin_instance, plugin_instance, @@ -222,13 +220,9 @@ static void swap_submit_derive (char const *type_instance, /* {{{ */ derive_t value) { value_list_t vl = VALUE_LIST_INIT; - value_t v[1]; - v[0].derive = value; - - vl.values = v; - vl.values_len = STATIC_ARRAY_SIZE (v); - sstrncpy (vl.host, hostname_g, sizeof (vl.host)); + vl.values = &(value_t) { .derive = value }; + vl.values_len = 1; sstrncpy (vl.plugin, "swap", sizeof (vl.plugin)); sstrncpy (vl.type, "swap_io", sizeof (vl.type)); sstrncpy (vl.type_instance, type_instance, sizeof (vl.type_instance));