From: Florian Forster Date: Sat, 10 Nov 2012 20:43:08 +0000 (+0100) Subject: aggregation plugin: Handle the initial EAGAIN return value of rate_to_value(). X-Git-Tag: collectd-5.2.0~24^2 X-Git-Url: https://git.verplant.org/?a=commitdiff_plain;h=fde8b86f075b8829b196b489e0dc294ff888d6ed;p=collectd.git aggregation plugin: Handle the initial EAGAIN return value of rate_to_value(). This avoids an annoying and confusing warning. --- diff --git a/src/aggregation.c b/src/aggregation.c index a9242234..e50557d9 100644 --- a/src/aggregation.c +++ b/src/aggregation.c @@ -241,6 +241,12 @@ static int agg_instance_read_func (agg_instance_t *inst, /* {{{ */ status = rate_to_value (&v, rate, state, inst->ds_type, t); if (status != 0) { + /* If this is the first iteration and rate_to_value() was asked to return a + * COUNTER or a DERIVE, it will return EAGAIN. Catch this and handle + * gracefully. */ + if (status == EAGAIN) + return (0); + WARNING ("aggregation plugin: rate_to_value failed with status %i.", status); return (-1);