projects
/
collectd.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
rrdtool plugin: Make sure "cache_timeout + random_variation" dosn't get negative.
[collectd.git]
/
src
/
rrdcached.c
diff --git
a/src/rrdcached.c
b/src/rrdcached.c
index
191df58
..
fb7eb79
100644
(file)
--- a/
src/rrdcached.c
+++ b/
src/rrdcached.c
@@
-25,6
+25,7
@@
#include "utils_rrdcreate.h"
#undef HAVE_CONFIG_H
#include "utils_rrdcreate.h"
#undef HAVE_CONFIG_H
+#include <rrd.h>
#include <rrd_client.h>
/*
#include <rrd_client.h>
/*
@@
-63,12
+64,14
@@
static int value_list_to_string (char *buffer, int buffer_len,
int offset;
int status;
int i;
int offset;
int status;
int i;
+ time_t t;
assert (0 == strcmp (ds->type, vl->type));
memset (buffer, '\0', buffer_len);
assert (0 == strcmp (ds->type, vl->type));
memset (buffer, '\0', buffer_len);
- status = ssnprintf (buffer, buffer_len, "%u", (unsigned int) vl->time);
+ t = CDTIME_T_TO_TIME_T (vl->time);
+ status = ssnprintf (buffer, buffer_len, "%lu", (unsigned long) t);
if ((status < 1) || (status >= buffer_len))
return (-1);
offset = status;
if ((status < 1) || (status >= buffer_len))
return (-1);
offset = status;
@@
-193,18
+196,14
@@
static int rc_config (const char *key, const char *value)
}
else if (strcasecmp ("CreateFiles", key) == 0)
{
}
else if (strcasecmp ("CreateFiles", key) == 0)
{
- if ((strcasecmp ("false", value) == 0)
- || (strcasecmp ("no", value) == 0)
- || (strcasecmp ("off", value) == 0))
+ if (IS_FALSE (value))
config_create_files = 0;
else
config_create_files = 1;
}
else if (strcasecmp ("CollectStatistics", key) == 0)
{
config_create_files = 0;
else
config_create_files = 1;
}
else if (strcasecmp ("CollectStatistics", key) == 0)
{
- if ((strcasecmp ("false", value) == 0)
- || (strcasecmp ("no", value) == 0)
- || (strcasecmp ("off", value) == 0))
+ if (IS_FALSE (value))
config_collect_stats = 0;
else
config_collect_stats = 1;
config_collect_stats = 0;
else
config_collect_stats = 1;