Code

src/utils_cache.c: Fix incorrect checking of persistent thresholds.
[collectd.git] / src / utils_cache.c
index 7c717a101643923ab211ec4bc5aa84b2d5bc8ad1..2995501aeafd020c69082eb751b068c7661740f6 100644 (file)
@@ -303,13 +303,13 @@ int uc_check_timeout (void)
       sfree (key);
       cache_free (ce);
     }
-    else if (status == 1) /* persist */
+    else if (status == 2) /* persist */
     {
       DEBUG ("uc_check_timeout: %s is missing, sending notification.",
          keys[i]);
       ce->state = STATE_MISSING;
     }
-    else if (status == 2) /* do not persist */
+    else if (status == 1) /* do not persist */
     {
       if (ce->state == STATE_MISSING)
       {
@@ -522,7 +522,7 @@ gauge_t *uc_get_rate (const data_set_t *ds, const value_list_t *vl)
 
   /* This is important - the caller has no other way of knowing how many
    * values are returned. */
-  if (ret_num != ds->ds_num)
+  if (ret_num != (size_t) ds->ds_num)
   {
     ERROR ("utils_cache: uc_get_rate: ds[%s] has %i values, "
        "but uc_get_rate_by_name returned %zu.",