X-Git-Url: https://git.octo.it/?p=rrdtool.git;a=blobdiff_plain;f=src%2Frrd_open.c;h=062de236b0b41c77674dd8fabc202e48e8482c50;hp=f74c6d8a677ea8c0e3068f271b8d970f61441f81;hb=896f660d222db6362e6171c68d33e8eecdc0d57a;hpb=2f0b984b0dfee0a8ab2cb1d41670f40a07ec5cdb diff --git a/src/rrd_open.c b/src/rrd_open.c index f74c6d8..062de23 100644 --- a/src/rrd_open.c +++ b/src/rrd_open.c @@ -6,10 +6,16 @@ * $Id$ *****************************************************************************/ +#ifdef WIN32 #include #include #include +#endif + +#ifdef HAVE_BROKEN_MS_ASYNC +#include #include +#endif #include "rrd_tool.h" #include "unused.h" @@ -107,15 +113,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++) @@ -472,7 +470,7 @@ void rrd_dontneed( size_t dontneed_start; size_t rra_start; size_t active_block; - unsigned long i; + size_t i; ssize_t _page_size = sysconf(_SC_PAGESIZE); if (rrd_file == NULL) {