X-Git-Url: https://git.octo.it/?a=blobdiff_plain;f=src%2Fchrony.c;h=77ba8cc460564d42ed6b8794080a36234e3c0199;hb=a9f509bacfda6be6882527a16563f260e4373246;hp=f6294e49112dabdcf70a0c84c78e96e40b2a5945;hpb=ed985cb9d3d89aec3490b17e0fda3ee97908f935;p=collectd.git diff --git a/src/chrony.c b/src/chrony.c index f6294e49..77ba8cc4 100644 --- a/src/chrony.c +++ b/src/chrony.c @@ -677,18 +677,12 @@ ntohf(tFloat p_float) static void chrony_push_data(const char *p_type, const char *p_type_inst, double p_value) { - value_t values[1]; value_list_t vl = VALUE_LIST_INIT; - values[0].gauge = p_value; /* TODO: Check type??? (counter, gauge, derive, absolute) */ - - vl.values = values; + vl.values = &(value_t) { .gauge = p_value }; vl.values_len = 1; /* XXX: Shall g_chrony_host/g_chrony_port be reflected in the plugin's output? */ - /* hostname_g is set in daemon/collectd.c (from config, via gethostname or by resolving localhost) */ - /* defined as: char hostname_g[DATA_MAX_NAME_LEN]; (never NULL) */ - sstrncpy(vl.host, hostname_g, sizeof(vl.host)); sstrncpy(vl.plugin, PLUGIN_NAME_SHORT, sizeof(vl.plugin)); if (g_chrony_plugin_instance != NULL) {