X-Git-Url: https://git.octo.it/?a=blobdiff_plain;f=src%2Frrd_open.c;h=f5dadbff876374e07fca40edf7f1d9a40ddcc4e5;hb=5c3b824e73337ebc150268f929246991b68d44f3;hp=88b50df76fe5e3fbfdb22f4d44c3ebddc9ccd3d0;hpb=a5eb18ad8c70e530a2e28ed435a0f52da0f5bee0;p=rrdtool.git diff --git a/src/rrd_open.c b/src/rrd_open.c index 88b50df..f5dadbf 100644 --- a/src/rrd_open.c +++ b/src/rrd_open.c @@ -1,5 +1,5 @@ /***************************************************************************** - * RRDtool 1.3rc8 Copyright by Tobi Oetiker, 1997-2008 + * RRDtool 1.3.0 Copyright by Tobi Oetiker, 1997-2008 ***************************************************************************** * rrd_open.c Open an RRD File ***************************************************************************** @@ -34,7 +34,7 @@ #endif /* get the address of the start of this page */ -#if defined USE_MADVISE || defined HAVE_POSIX_FADVISE +#if defined USE_MADVISE || defined HAVE_POSIX_FADVISE #ifndef PAGE_START #define PAGE_START(addr) ((addr)&(~(_page_size-1))) #endif @@ -117,6 +117,10 @@ rrd_file_t *rrd_open( #endif } +#if defined(_WIN32) && !defined(__CYGWIN__) && !defined(__CYGWIN32__) + flags |= O_BINARY; +#endif + if ((rrd_file->fd = open(file_name, flags, mode)) < 0) { rrd_set_error("opening '%s': %s", file_name, rrd_strerror(errno)); goto out_free; @@ -371,7 +375,7 @@ void rrd_dontneed( #if defined DEBUG && DEBUG > 1 mincore_print(rrd_file, "after"); #endif -#endif /* without madvise and posix_fadvise ist does not make much sense todo anything */ +#endif /* without madvise and posix_fadvise ist does not make much sense todo anything */ } @@ -563,4 +567,3 @@ void rrd_freemem( { free(mem); } -