src/utils_tail_match.c: Submit NAN if type if gauge and no values were matched.
authorFlorian Forster <octo@huhu.verplant.org>
Sun, 24 Feb 2008 14:40:30 +0000 (15:40 +0100)
committerFlorian Forster <octo@huhu.verplant.org>
Sun, 24 Feb 2008 14:40:30 +0000 (15:40 +0100)
src/utils_tail_match.c

index 06412b9..34fe2dc 100644 (file)
@@ -72,7 +72,11 @@ static int simple_submit_match (cu_match_t *match, void *user_data)
   if (match_value == NULL)
     return (-1);
 
-  values[0] = match_value->value;
+  if ((match_value->ds_type & UTILS_MATCH_DS_TYPE_GAUGE)
+      && (match_value->values_num == 0))
+    values[0].gauge = NAN;
+  else
+    values[0] = match_value->value;
 
   vl.values = values;
   vl.values_len = 1;