projects
/
collectd.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Auto-Merge pull request #2949 from rubenk/fix-detection-of-xmms
[collectd.git]
/
src
/
rrdtool.c
diff --git
a/src/rrdtool.c
b/src/rrdtool.c
index
5f42561
..
cd275da
100644
(file)
--- a/
src/rrdtool.c
+++ b/
src/rrdtool.c
@@
-623,9
+623,8
@@
static int rrd_cache_insert(const char *filename, const char *value,
return -1;
}
return -1;
}
- c_avl_get(cache, filename, (void *)&rc);
-
- if (rc == NULL) {
+ int status = c_avl_get(cache, filename, (void *)&rc);
+ if ((status != 0) || (rc == NULL)) {
rc = malloc(sizeof(*rc));
if (rc == NULL) {
pthread_mutex_unlock(&cache_lock);
rc = malloc(sizeof(*rc));
if (rc == NULL) {
pthread_mutex_unlock(&cache_lock);
@@
-803,7
+802,7
@@
static int rrd_write(const data_set_t *ds, const value_list_t *vl,
if (value_list_to_filename(filename, sizeof(filename), vl) != 0)
return -1;
if (value_list_to_filename(filename, sizeof(filename), vl) != 0)
return -1;
- char values[32 *
ds->ds_num
];
+ char values[32 *
(ds->ds_num + 1)
];
if (value_list_to_string(values, sizeof(values), ds, vl) != 0)
return -1;
if (value_list_to_string(values, sizeof(values), ds, vl) != 0)
return -1;
@@
-1047,8
+1046,7
@@
static int rrd_init(void) {
cache_flush_timeout = 0;
} else if (cache_flush_timeout < cache_timeout) {
INFO("rrdtool plugin: \"CacheFlush %.3f\" is less than \"CacheTimeout "
cache_flush_timeout = 0;
} else if (cache_flush_timeout < cache_timeout) {
INFO("rrdtool plugin: \"CacheFlush %.3f\" is less than \"CacheTimeout "
- "%.3f\". "
- "Ajusting \"CacheFlush\" to %.3f seconds.",
+ "%.3f\". Adjusting \"CacheFlush\" to %.3f seconds.",
CDTIME_T_TO_DOUBLE(cache_flush_timeout),
CDTIME_T_TO_DOUBLE(cache_timeout),
CDTIME_T_TO_DOUBLE(cache_timeout * 10));
CDTIME_T_TO_DOUBLE(cache_flush_timeout),
CDTIME_T_TO_DOUBLE(cache_timeout),
CDTIME_T_TO_DOUBLE(cache_timeout * 10));