projects
/
rrdtool.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
I realize now that the problem is the line
[rrdtool.git]
/
src
/
rrd_restore.c
diff --git
a/src/rrd_restore.c
b/src/rrd_restore.c
index
d92210f
..
ab8b138
100644
(file)
--- a/
src/rrd_restore.c
+++ b/
src/rrd_restore.c
@@
-1,5
+1,5
@@
/*****************************************************************************
/*****************************************************************************
- * RRDtool 1.3.
1
Copyright by Tobi Oetiker, 1997-2008
+ * RRDtool 1.3.
2
Copyright by Tobi Oetiker, 1997-2008
* This file: Copyright 2008 Florian octo Forster
* Distributed under the GPL
*****************************************************************************
* This file: Copyright 2008 Florian octo Forster
* Distributed under the GPL
*****************************************************************************
@@
-318,9
+318,9
@@
static int parse_tag_rra_cdp_prep_ds(
status = 0;
for (child = node->xmlChildrenNode; child != NULL; child = child->next) {
status = 0;
for (child = node->xmlChildrenNode; child != NULL; child = child->next) {
- if (atoi(rrd->stat_head->version) == 1){
-
cdp_prep->scratch[CDP_primary_val].u_val = 0.0;
-
cdp_prep->scratch[CDP_secondary_val].u_val = 0.0;
+ if (atoi(rrd->stat_head->version) == 1)
{
+ cdp_prep->scratch[CDP_primary_val].u_val = 0.0;
+ cdp_prep->scratch[CDP_secondary_val].u_val = 0.0;
}
if ((xmlStrcmp(child->name, (const xmlChar *) "comment") == 0)
|| (xmlStrcmp(child->name, (const xmlChar *) "text") == 0))
}
if ((xmlStrcmp(child->name, (const xmlChar *) "comment") == 0)
|| (xmlStrcmp(child->name, (const xmlChar *) "text") == 0))
@@
-676,7
+676,8
@@
static int parse_tag_rra(
else if (atoi(rrd->stat_head->version) == 1
&& xmlStrcmp(child->name, (const xmlChar *) "xff") == 0)
status = get_double_from_node(doc, child,
else if (atoi(rrd->stat_head->version) == 1
&& xmlStrcmp(child->name, (const xmlChar *) "xff") == 0)
status = get_double_from_node(doc, child,
- (double *) &cur_rra_def->par[RRA_cdp_xff_val].u_val);
+ (double *) &cur_rra_def->
+ par[RRA_cdp_xff_val].u_val);
else if (atoi(rrd->stat_head->version) >= 2
&& xmlStrcmp(child->name, (const xmlChar *) "params") == 0)
status = parse_tag_rra_params(doc, child, cur_rra_def);
else if (atoi(rrd->stat_head->version) >= 2
&& xmlStrcmp(child->name, (const xmlChar *) "params") == 0)
status = parse_tag_rra_params(doc, child, cur_rra_def);
@@
-995,9
+996,9
@@
static int write_file(
return (-1);
}
}
return (-1);
}
}
- if (atoi(rrd->stat_head->version) < 3){
+ if (atoi(rrd->stat_head->version) < 3)
{
/* we output 3 or higher */
/* we output 3 or higher */
- strcpy(rrd->stat_head->version,
"0003");
+ strcpy(rrd->stat_head->version,
"0003");
}
fwrite(rrd->stat_head, sizeof(stat_head_t), 1, fh);
fwrite(rrd->ds_def, sizeof(ds_def_t), rrd->stat_head->ds_cnt, fh);
}
fwrite(rrd->stat_head, sizeof(stat_head_t), 1, fh);
fwrite(rrd->ds_def, sizeof(ds_def_t), rrd->stat_head->ds_cnt, fh);
@@
-1009,18
+1010,18
@@
static int write_file(
fwrite(rrd->rra_ptr, sizeof(rra_ptr_t), rrd->stat_head->rra_cnt, fh);
/* calculate the number of rrd_values to dump */
fwrite(rrd->rra_ptr, sizeof(rra_ptr_t), rrd->stat_head->rra_cnt, fh);
/* calculate the number of rrd_values to dump */
- rra_offset=0;
- for(i=0; i < rrd->stat_head->rra_cnt; i++)
- {
+ rra_offset = 0;
+ for (i = 0; i < rrd->stat_head->rra_cnt; i++) {
unsigned long num_rows = rrd->rra_def[i].row_cnt;
unsigned long cur_row = rrd->rra_ptr[i].cur_row;
unsigned long ds_cnt = rrd->stat_head->ds_cnt;
unsigned long num_rows = rrd->rra_def[i].row_cnt;
unsigned long cur_row = rrd->rra_ptr[i].cur_row;
unsigned long ds_cnt = rrd->stat_head->ds_cnt;
- fwrite(rrd->rrd_value + (rra_offset + num_rows-1 - cur_row) * ds_cnt,
- sizeof(rrd_value_t), (cur_row+1)*ds_cnt, fh);
+ fwrite(rrd->rrd_value +
+ (rra_offset + num_rows - 1 - cur_row) * ds_cnt,
+ sizeof(rrd_value_t), (cur_row + 1) * ds_cnt, fh);
fwrite(rrd->rrd_value + rra_offset * ds_cnt,
fwrite(rrd->rrd_value + rra_offset * ds_cnt,
- sizeof(rrd_value_t), (num_rows
-1 - cur_row)*
ds_cnt, fh);
+ sizeof(rrd_value_t), (num_rows
- 1 - cur_row) *
ds_cnt, fh);
rra_offset += num_rows;
}
rra_offset += num_rows;
}
@@
-1042,7
+1043,7
@@
int rrd_restore(
{
rrd_t *rrd;
{
rrd_t *rrd;
- srandom((unsigned int)
time(NULL) + (unsigned int)
getpid());
+ srandom((unsigned int)
time(NULL) + (unsigned int)
getpid());
/* init rrd clean */
optind = 0;
opterr = 0; /* initialize getopt */
/* init rrd clean */
optind = 0;
opterr = 0; /* initialize getopt */