X-Git-Url: https://git.verplant.org/?a=blobdiff_plain;f=src%2Fzookeeper.c;h=a42b04c83f1ad06a11cff37af69d8b6b4efa1017;hb=2412d3ca76f7ac24e67543720c1d385188da0ce3;hp=37aac80b2a8f3ebcf0a3036ca6dcbf680cffc9ab;hpb=79963d13c1884d1d92667cc502ad20758b084a12;p=collectd.git diff --git a/src/zookeeper.c b/src/zookeeper.c index 37aac80b..a42b04c8 100644 --- a/src/zookeeper.c +++ b/src/zookeeper.c @@ -57,15 +57,11 @@ static int zookeeper_config(const char *key, const char *value) { } static void zookeeper_submit_gauge(const char *type, const char *type_inst, - gauge_t val) { - value_t values[1]; + gauge_t value) { 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)); sstrncpy(vl.type, type, sizeof(vl.type)); if (type_inst != NULL) @@ -75,15 +71,11 @@ static void zookeeper_submit_gauge(const char *type, const char *type_inst, } /* zookeeper_submit_gauge */ static void zookeeper_submit_derive(const char *type, const char *type_inst, - derive_t val) { - value_t values[1]; + derive_t value) { 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)); sstrncpy(vl.type, type, sizeof(vl.type)); if (type_inst != NULL)