X-Git-Url: https://git.octo.it/?a=blobdiff_plain;ds=sidebyside;f=src%2Futils_cache.c;h=b9b896215be1cb631f5c1b0252bcf4c341af6846;hb=c5dd07b67b8f41af7c971117a026c4c1fa406ec9;hp=224748f2e65b714c1318d846072147c13f048605;hpb=540075ba2da73c2282bdfab894a5d12eabeffa65;p=collectd.git diff --git a/src/utils_cache.c b/src/utils_cache.c index 224748f2..b9b89621 100644 --- a/src/utils_cache.c +++ b/src/utils_cache.c @@ -305,22 +305,22 @@ int uc_check_timeout (void) { DEBUG ("uc_check_timeout: %s is missing, sending notification.", keys[i]); - ce->state = STATE_ERROR; + ce->state = STATE_MISSING; } else if (status == 2) /* do not persist */ { - if (ce->state == STATE_ERROR) + if (ce->state == STATE_MISSING) { DEBUG ("uc_check_timeout: %s is missing but " "notification has already been sent.", keys[i]); sfree (keys[i]); } - else /* (ce->state != STATE_ERROR) */ + else /* (ce->state != STATE_MISSING) */ { DEBUG ("uc_check_timeout: %s is missing, sending one notification.", keys[i]); - ce->state = STATE_ERROR; + ce->state = STATE_MISSING; } } else @@ -389,7 +389,7 @@ int uc_update (const data_set_t *ds, const value_list_t *vl) /* Send a notification (after the lock has been released) if we switch the * state from something else to `okay'. */ - if (ce->state != STATE_OKAY) + if (ce->state == STATE_MISSING) { send_okay_notification = 1; ce->state = STATE_OKAY; @@ -526,11 +526,6 @@ int uc_set_state (const data_set_t *ds, const value_list_t *vl, int state) cache_entry_t *ce = NULL; int ret = -1; - if (state < STATE_OKAY) - state = STATE_OKAY; - if (state > STATE_ERROR) - state = STATE_ERROR; - if (FORMAT_VL (name, sizeof (name), vl, ds) != 0) { ERROR ("uc_get_state: FORMAT_VL failed.");