X-Git-Url: https://git.octo.it/?a=blobdiff_plain;f=src%2Fzookeeper.c;h=7e551918d2303b5fa68d759a63cc981e4ef20f86;hb=e14e8b7f5c5bf9d0fe5cc632c6383f304d4ac2ad;hp=84174853d24c62bd8ba22aaa17bc28e5f68aaa3d;hpb=ec9ed6fe4108f7fd3d4ef84e887bb6d3dc022e14;p=collectd.git diff --git a/src/zookeeper.c b/src/zookeeper.c index 84174853..7e551918 100644 --- a/src/zookeeper.c +++ b/src/zookeeper.c @@ -66,14 +66,11 @@ static int zookeeper_config(const char *key, const char *value) return 0; } -static void zookeeper_submit_gauge (const char * type, const char * type_inst, gauge_t val) +static void zookeeper_submit_gauge (const char * type, const char * type_inst, gauge_t value) { - value_t values[1]; value_list_t vl = VALUE_LIST_INIT; - values[0].gauge = val; - - vl.values = values; + vl.values = &(value_t) { .gauge = value }; vl.values_len = 1; sstrncpy (vl.host, hostname_g, sizeof (vl.host)); sstrncpy (vl.plugin, "zookeeper", sizeof (vl.plugin)); @@ -84,14 +81,11 @@ static void zookeeper_submit_gauge (const char * type, const char * type_inst, g plugin_dispatch_values (&vl); } /* zookeeper_submit_gauge */ -static void zookeeper_submit_derive (const char * type, const char * type_inst, derive_t val) +static void zookeeper_submit_derive (const char * type, const char * type_inst, derive_t value) { - value_t values[1]; value_list_t vl = VALUE_LIST_INIT; - values[0].derive = val; - - vl.values = values; + vl.values = &(value_t) { .derive = value }; vl.values_len = 1; sstrncpy (vl.host, hostname_g, sizeof (vl.host)); sstrncpy (vl.plugin, "zookeeper", sizeof (vl.plugin));