summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 1f8f1d8)
raw | patch | inline | side by side (parent: 1f8f1d8)
author | oetiker <oetiker@a5681a0c-68f1-0310-ab6d-d61299d08faa> | |
Tue, 10 Jun 2008 09:35:03 +0000 (09:35 +0000) | ||
committer | oetiker <oetiker@a5681a0c-68f1-0310-ab6d-d61299d08faa> | |
Tue, 10 Jun 2008 09:35:03 +0000 (09:35 +0000) |
program/doc/rrdcreate.pod | patch | blob | history | |
program/src/rrd_create.c | patch | blob | history |
index 86817bd4dbeb60bc0c9233244744cd41e7e20165..03012e035e2739ce6eae79584fcc191844d44acb 100644 (file)
a I<consolidated data point> which then goes into the archive.
I<rows> defines how many generations of data values are kept in an B<RRA>.
+Obviously, this has to be greater than zero.
=back
index 028123ef46f4a65ce2704a755b8fd0d5e7dbf1fa..6d7cb18e977af78a55a2afc55069d5923e1084d8 100644 (file)
--- a/program/src/rrd_create.c
+++ b/program/src/rrd_create.c
char *argvcopy;
char *tokptr;
size_t old_size = sizeof(rra_def_t) * (rrd.stat_head->rra_cnt);
+ int row_cnt;
if ((rrd.rra_def = rrd_realloc(rrd.rra_def,
old_size + sizeof(rra_def_t))) ==
case CF_SEASONAL:
case CF_DEVPREDICT:
case CF_FAILURES:
- rrd.rra_def[rrd.stat_head->rra_cnt].row_cnt =
- atoi(token);
+ row_cnt = atoi(token);
+ rrd.rra_def[rrd.stat_head->rra_cnt].row_cnt = row_cnt;
+ if (row_cnt <= 0)
+ rrd_set_error("Invalid row count: %i", row_cnt);
break;
default:
rrd.rra_def[rrd.stat_head->rra_cnt].
("Unexpected extra argument for consolidation function DEVPREDICT");
break;
default:
- rrd.rra_def[rrd.stat_head->rra_cnt].row_cnt =
- atoi(token);
+ row_cnt = atoi(token);
+ rrd.rra_def[rrd.stat_head->rra_cnt].row_cnt = row_cnt;
+ if (row_cnt <= 0)
+ rrd_set_error("Invalid row count: %i", row_cnt);
break;
}
break;