X-Git-Url: https://git.octo.it/?a=blobdiff_plain;f=src%2Frrd_open.c;h=42426c6e092be4b3322274f5c72de7b15e3a7d9b;hb=1d0d1678df2083bc996d579e0c5d0cc46fff6745;hp=f74c6d8a677ea8c0e3068f271b8d970f61441f81;hpb=1a717ae21423bc6fc0ac6fd1b675d2bf689a79e8;p=rrdtool.git diff --git a/src/rrd_open.c b/src/rrd_open.c index f74c6d8..42426c6 100644 --- a/src/rrd_open.c +++ b/src/rrd_open.c @@ -107,15 +107,7 @@ rrd_file_t *rrd_open( /* Are we creating a new file? */ if((rdwr & RRD_CREAT) && (rrd->stat_head != NULL)) { - header_len = \ - sizeof(stat_head_t) + \ - sizeof(ds_def_t) * rrd->stat_head->ds_cnt + \ - sizeof(rra_def_t) * rrd->stat_head->rra_cnt + \ - sizeof(time_t) + \ - sizeof(live_head_t) + \ - sizeof(pdp_prep_t) * rrd->stat_head->ds_cnt + \ - sizeof(cdp_prep_t) * rrd->stat_head->ds_cnt * rrd->stat_head->rra_cnt + \ - sizeof(rra_ptr_t) * rrd->stat_head->rra_cnt; + header_len = rrd_get_header_size(rrd); value_cnt = 0; for (ui = 0; ui < rrd->stat_head->rra_cnt; ui++)