From: Florian Forster Date: Sat, 12 May 2007 18:00:16 +0000 (+0200) Subject: unixsock plugin: Don't assert that `ds->ds_num == vl->values_num' when not built... X-Git-Tag: collectd-4.0.0~44 X-Git-Url: https://git.octo.it/?a=commitdiff_plain;ds=inline;h=caa30bd46d739c5527d59106e07568ad9056d99e;p=collectd.git unixsock plugin: Don't assert that `ds->ds_num == vl->values_num' when not built with debugging enabled. --- diff --git a/src/unixsock.c b/src/unixsock.c index 8211bf46..a74e64e6 100644 --- a/src/unixsock.c +++ b/src/unixsock.c @@ -152,7 +152,17 @@ static int cache_insert (const data_set_t *ds, const value_list_t *vl) DEBUG ("unixsock plugin: cache_insert: ds->type = %s; ds->ds_num = %i;" " vl->values_len = %i;", ds->type, ds->ds_num, vl->values_len); +#if COLLECT_DEBUG assert (ds->ds_num == vl->values_len); +#else + if (ds->ds_num != vl->values_len) + { + ERROR ("unixsock plugin: ds->type = %s: (ds->ds_num = %i) != " + "(vl->values_len = %i)", + ds->type, ds->ds_num, vl->values_len); + return (-1); + } +#endif vc = (value_cache_t *) malloc (sizeof (value_cache_t)); if (vc == NULL)