X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=src%2Frrdcached.c;h=07eac7b67c1672a6b1da902a03d0c983d1fe2b41;hb=c4bce475033d055cf5370b33fc6b8675fad5667b;hp=0425419445d738a6e80992c77c51b229112ca173;hpb=da612fa9c6a3343b43789569d64197d7c690be52;p=collectd.git diff --git a/src/rrdcached.c b/src/rrdcached.c index 04254194..07eac7b6 100644 --- a/src/rrdcached.c +++ b/src/rrdcached.c @@ -292,8 +292,9 @@ static int rc_read (void) int status; rrdc_stats_t *head; - value_t values[1]; value_list_t vl = VALUE_LIST_INIT; + vl.values = &(value_t) { .gauge = NAN }; + vl.values_len = 1; if (daemon_address == NULL) return (-1); @@ -301,9 +302,6 @@ static int rc_read (void) if (!config_collect_stats) return (-1); - vl.values = values; - vl.values_len = 1; - if ((strncmp ("unix:", daemon_address, strlen ("unix:")) == 0) || (daemon_address[0] == '/')) sstrncpy (vl.host, hostname_g, sizeof (vl.host)); @@ -330,9 +328,9 @@ static int rc_read (void) for (rrdc_stats_t *ptr = head; ptr != NULL; ptr = ptr->next) { if (ptr->type == RRDC_STATS_TYPE_GAUGE) - values[0].gauge = (gauge_t) ptr->value.gauge; + vl.values[0].gauge = (gauge_t) ptr->value.gauge; else if (ptr->type == RRDC_STATS_TYPE_COUNTER) - values[0].counter = (counter_t) ptr->value.counter; + vl.values[0].counter = (counter_t) ptr->value.counter; else continue;