summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: ba2ee9a)
raw | patch | inline | side by side (parent: ba2ee9a)
author | Florian Forster <octo@collectd.org> | |
Sun, 21 Aug 2011 14:50:29 +0000 (16:50 +0200) | ||
committer | Florian Forster <octo@collectd.org> | |
Sun, 21 Aug 2011 14:50:29 +0000 (16:50 +0200) |
Change-Id: Ibd4dd3f17db62b10b96c59f37b66941ddc5ea7b0
src/rrdtool.c | patch | blob | history | |
src/utils_rrdcreate.c | patch | blob | history | |
src/utils_rrdcreate.h | patch | blob | history |
diff --git a/src/rrdtool.c b/src/rrdtool.c
index b366a9c64166eeeae135f700b069e81578cac28a..56a82d0321b8a875fdc1a8b5c93e312550388b77 100644 (file)
--- a/src/rrdtool.c
+++ b/src/rrdtool.c
}
else if (strcasecmp ("StepSize", key) == 0)
{
- int temp = atoi (value);
+ unsigned long temp = strtoul (value, NULL, 0);
if (temp > 0)
rrdcreate_config.stepsize = temp;
}
return (0);
init_once = 1;
- if (rrdcreate_config.stepsize < 0)
- rrdcreate_config.stepsize = 0;
if (rrdcreate_config.heartbeat <= 0)
rrdcreate_config.heartbeat = 2 * rrdcreate_config.stepsize;
}
queue_thread_running = 1;
- DEBUG ("rrdtool plugin: rrd_init: datadir = %s; stepsize = %i;"
+ DEBUG ("rrdtool plugin: rrd_init: datadir = %s; stepsize = %lu;"
" heartbeat = %i; rrarows = %i; xff = %lf;",
(datadir == NULL) ? "(null)" : datadir,
rrdcreate_config.stepsize,
diff --git a/src/utils_rrdcreate.c b/src/utils_rrdcreate.c
index 5b1323886bc8a498a77ae3216df1dadd893b851b..d9cbad7326b24f2e32cd9dfe122651dbd479a5e2 100644 (file)
--- a/src/utils_rrdcreate.c
+++ b/src/utils_rrdcreate.c
int ds_num;
int status = 0;
time_t last_up;
- int stepsize;
+ unsigned long stepsize;
if (check_create_dir (filename))
return (-1);
if (cfg->stepsize > 0)
stepsize = cfg->stepsize;
else
- stepsize = (int) CDTIME_T_TO_TIME_T (vl->interval);
+ stepsize = (unsigned long) CDTIME_T_TO_TIME_T (vl->interval);
- status = srrd_create (filename,
- (cfg->stepsize > 0) ? cfg->stepsize : CDTIME_T_TO_TIME_T (vl->interval),
- last_up,
+ status = srrd_create (filename, stepsize, last_up,
argc, (const char **) argv);
free (argv);
diff --git a/src/utils_rrdcreate.h b/src/utils_rrdcreate.h
index 935e4e0783dd7710640cb97869c45a7711d8f782..103ca57070ad3b99fa72183966eefdbd69a1fedc 100644 (file)
--- a/src/utils_rrdcreate.h
+++ b/src/utils_rrdcreate.h
struct rrdcreate_config_s
{
- int stepsize;
+ unsigned long stepsize;
int heartbeat;
int rrarows;
double xff;