Code

unixsock plugin: Don't assert that `ds->ds_num == vl->values_num' when not built...
authorFlorian Forster <octo@leeloo.lan.home.verplant.org>
Sat, 12 May 2007 18:00:16 +0000 (20:00 +0200)
committerFlorian Forster <octo@leeloo.lan.home.verplant.org>
Sat, 12 May 2007 18:00:16 +0000 (20:00 +0200)
src/unixsock.c

index 8211bf46e9f7a686395183444b06da7fd90e1977..a74e64e69e23b5d91c72f8815eb1c5cd7635b5a9 100644 (file)
@@ -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)