projects
/
collectd.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
ba4b245
)
src/utils_cache.c: Improve a couple of comments.
author
Florian Forster
<octo@noris.net>
Wed, 29 Sep 2010 15:47:19 +0000
(17:47 +0200)
committer
Florian Forster
<octo@noris.net>
Wed, 29 Sep 2010 15:47:19 +0000
(17:47 +0200)
src/utils_cache.c
patch
|
blob
|
history
diff --git
a/src/utils_cache.c
b/src/utils_cache.c
index
2e33ab0
..
b7eacf3
100644
(file)
--- a/
src/utils_cache.c
+++ b/
src/utils_cache.c
@@
-121,6
+121,7
@@
static void cache_free (cache_entry_t *ce)
sfree (ce);
} /* void cache_free */
sfree (ce);
} /* void cache_free */
+/* Send out notifications for "missing" values. */
static int uc_send_notification (const char *name)
{
cache_entry_t *ce = NULL;
static int uc_send_notification (const char *name)
{
cache_entry_t *ce = NULL;
@@
-155,8
+156,9
@@
static int uc_send_notification (const char *name)
return (-1);
}
return (-1);
}
- memset (&ds, '\0', sizeof (ds));
- memset (&vl, '\0', sizeof (vl));
+ memset (&ds, 0, sizeof (ds));
+ memset (&vl, 0, sizeof (vl));
+
sstrncpy (vl.host, host, sizeof (vl.host));
sstrncpy (vl.plugin, plugin, sizeof (vl.plugin));
if (plugin_instance != NULL)
sstrncpy (vl.host, host, sizeof (vl.host));
sstrncpy (vl.plugin, plugin, sizeof (vl.plugin));
if (plugin_instance != NULL)
@@
-166,7
+168,6
@@
static int uc_send_notification (const char *name)
if (type_instance != NULL)
sstrncpy (vl.type_instance, type_instance, sizeof (vl.type_instance));
if (type_instance != NULL)
sstrncpy (vl.type_instance, type_instance, sizeof (vl.type_instance));
-
/* Copy the associative members */
notification_init (&n, NOTIF_FAILURE, /* host = */ NULL,
host, plugin, plugin_instance, type, type_instance);
/* Copy the associative members */
notification_init (&n, NOTIF_FAILURE, /* host = */ NULL,
host, plugin, plugin_instance, type, type_instance);
@@
-192,7
+193,8
@@
static int uc_send_notification (const char *name)
return (-1);
}
return (-1);
}
- /* Check if the entry has been updated in the meantime */
+ /* Check if the entry has been updated since we marked it as "missing" in
+ * uc_check_timeout() */
if ((n.time - ce->last_update) < (2 * ce->interval))
{
ce->state = STATE_OKAY;
if ((n.time - ce->last_update) < (2 * ce->interval))
{
ce->state = STATE_OKAY;