projects
/
collectd.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
virt plugin: Fixed virt_notif_thread_init() place
[collectd.git]
/
src
/
rrdtool.c
diff --git
a/src/rrdtool.c
b/src/rrdtool.c
index
5c87a43
..
d0849d1
100644
(file)
--- a/
src/rrdtool.c
+++ b/
src/rrdtool.c
@@
-25,11
+25,11
@@
#include "collectd.h"
#include "collectd.h"
-#include "common.h"
#include "plugin.h"
#include "plugin.h"
-#include "utils_avltree.h"
+#include "utils/avltree/avltree.h"
+#include "utils/common/common.h"
+#include "utils/rrdcreate/rrdcreate.h"
#include "utils_random.h"
#include "utils_random.h"
-#include "utils_rrdcreate.h"
#include <rrd.h>
#include <rrd.h>
@@
-569,7
+569,7
@@
static int rrd_cache_flush_identifier(cdtime_t timeout,
snprintf(key, sizeof(key), "%s.rrd", identifier);
else
snprintf(key, sizeof(key), "%s/%s.rrd", datadir, identifier);
snprintf(key, sizeof(key), "%s.rrd", identifier);
else
snprintf(key, sizeof(key), "%s/%s.rrd", datadir, identifier);
- key[sizeof(key) - 1] =
0
;
+ key[sizeof(key) - 1] =
'\0'
;
status = c_avl_get(cache, key, (void *)&rc);
if (status != 0) {
status = c_avl_get(cache, key, (void *)&rc);
if (status != 0) {
@@
-624,6
+624,7
@@
static int rrd_cache_insert(const char *filename, const char *value,
if ((status != 0) || (rc == NULL)) {
rc = malloc(sizeof(*rc));
if (rc == NULL) {
if ((status != 0) || (rc == NULL)) {
rc = malloc(sizeof(*rc));
if (rc == NULL) {
+ ERROR("rrdtool plugin: malloc failed: %s", STRERRNO);
pthread_mutex_unlock(&cache_lock);
return -1;
}
pthread_mutex_unlock(&cache_lock);
return -1;
}
@@
-790,17
+791,22
@@
static int rrd_write(const data_set_t *ds, const value_list_t *vl,
}
char filename[PATH_MAX];
}
char filename[PATH_MAX];
- if (value_list_to_filename(filename, sizeof(filename), vl) != 0)
+ if (value_list_to_filename(filename, sizeof(filename), vl) != 0) {
+ ERROR("rrdtool plugin: failed to build filename");
return -1;
return -1;
+ }
char values[32 * (ds->ds_num + 1)];
char values[32 * (ds->ds_num + 1)];
- if (value_list_to_string(values, sizeof(values), ds, vl) != 0)
+ if (value_list_to_string(values, sizeof(values), ds, vl) != 0) {
+ ERROR("rrdtool plugin: failed to build values string");
return -1;
return -1;
+ }
struct stat statbuf = {0};
if (stat(filename, &statbuf) == -1) {
if (errno == ENOENT) {
if (cu_rrd_create_file(filename, ds, vl, &rrdcreate_config) != 0) {
struct stat statbuf = {0};
if (stat(filename, &statbuf) == -1) {
if (errno == ENOENT) {
if (cu_rrd_create_file(filename, ds, vl, &rrdcreate_config) != 0) {
+ ERROR("rrdtool plugin: cu_rrd_create_file (%s) failed.", filename);
return -1;
} else if (rrdcreate_config.async) {
return 0;
return -1;
} else if (rrdcreate_config.async) {
return 0;