projects
/
collectd.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
src/utils_{cache,threshold}.c: Fix the concept of failed and missing values.
[collectd.git]
/
src
/
utils_cache.c
diff --git
a/src/utils_cache.c
b/src/utils_cache.c
index
224748f
..
b9b8962
100644
(file)
--- 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]);
{
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 */
{
}
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]);
}
{
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]);
{
DEBUG ("uc_check_timeout: %s is missing, sending one notification.",
keys[i]);
- ce->state = STATE_
ERROR
;
+ ce->state = STATE_
MISSING
;
}
}
else
}
}
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'. */
/* 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;
{
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;
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.");
if (FORMAT_VL (name, sizeof (name), vl, ds) != 0)
{
ERROR ("uc_get_state: FORMAT_VL failed.");