rrdtool plugin: Make sure "cache_timeout + random_variation" dosn't get negative.
[collectd.git] / src / gmond.c
index 3357ea0..8c774e5 100644 (file)
@@ -542,9 +542,9 @@ static int staging_entry_update (const char *host, const char *name, /* {{{ */
   else if (ds_type == DS_TYPE_GAUGE)
     se->vl.values[ds_index].gauge = value.gauge;
   else if (ds_type == DS_TYPE_DERIVE)
-    se->vl.values[ds_index].DERIVE += value.derive;
+    se->vl.values[ds_index].derive += value.derive;
   else if (ds_type == DS_TYPE_ABSOLUTE)
-    se->vl.values[ds_index].ABSOLUTE = value.absolute;
+    se->vl.values[ds_index].absolute = value.absolute;
 
   se->flags |= (0x01 << ds_index);
 
@@ -719,7 +719,7 @@ static int mc_handle_metadata_msg (Ganglia_metadata_msg *msg) /* {{{ */
           map->type, map->type_instance,
           ds->ds_num);
       if (se != NULL)
-        se->vl.interval = (int) msg_meta.metric.tmax;
+        se->vl.interval = TIME_T_TO_CDTIME_T (msg_meta.metric.tmax);
       pthread_mutex_unlock (&staging_lock);
 
       if (se == NULL)