summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 7ff7165)
raw | patch | inline | side by side (parent: 7ff7165)
author | Florian Forster <octo@leeloo.lan.home.verplant.org> | |
Sun, 3 Jun 2007 17:05:34 +0000 (19:05 +0200) | ||
committer | Florian Forster <octo@leeloo.lan.home.verplant.org> | |
Sun, 3 Jun 2007 17:05:34 +0000 (19:05 +0200) |
src/rrdtool.c | patch | blob | history |
diff --git a/src/rrdtool.c b/src/rrdtool.c
index feed01c246dc0bad24c060447b1006c4b21cffc3..eb876a3c36ae2d12f1991243a5bb0fe6f5dd67b1 100644 (file)
--- a/src/rrdtool.c
+++ b/src/rrdtool.c
static int rrd_write_to_file (char *filename, char **values, int values_num)
{
char **argv;
- int argc;
-
- char *fn;
+ int argc;
int status;
if (values_num < 1)
status = -1;
}
- free (argv);
- free (fn);
+ sfree (argv);
return (status);
} /* int rrd_write_cache_entry */
pthread_cond_signal (&queue_cond);
pthread_mutex_unlock (&queue_lock);
+ DEBUG ("rrdtool plugin: Put `%s' into the update queue", filename);
+
return (0);
} /* int rrd_queue_cache_entry */
sfree (rc);
return (-1);
}
+ rc->values = values_new;
rc->values[rc->values_num] = strdup (value);
if (rc->values[rc->values_num] != NULL)
DEBUG ("rrd_cache_insert (%s, %s, %u) = %p", filename, value,
(unsigned int) value_time, (void *) rc);
- if (((rc->last_value - rc->first_value) >= cache_timeout)
- && (rc->flags != FLAG_QUEUED))
+ if ((rc->last_value - rc->first_value) >= cache_timeout)
{
/* XXX: If you need to lock both, cache_lock and queue_lock, at
* the same time, ALWAYS lock `cache_lock' first! */
- if (rrd_queue_cache_entry (filename) == 0)
- rc->flags = FLAG_QUEUED;
+ if (rc->flags != FLAG_QUEUED)
+ {
+ if (rrd_queue_cache_entry (filename) == 0)
+ rc->flags = FLAG_QUEUED;
+ }
+ else
+ {
+ DEBUG ("rrdtool plugin: `%s' is already queued.", filename);
+ }
}
if ((cache_timeout > 0) &&