X-Git-Url: https://git.octo.it/?p=rrdtool.git;a=blobdiff_plain;f=src%2Frrd_open.c;h=76c333f60ef99f2048dba724faceaa826d4e7b22;hp=443a1a5652a50c01a023a47c6fb51773241d364d;hb=990fcfb7eec407edfe504f42760bae204e1c074d;hpb=59ffebeb1600f4bd7b0ff79fb2bc08941d3a0195 diff --git a/src/rrd_open.c b/src/rrd_open.c index 443a1a5..76c333f 100644 --- a/src/rrd_open.c +++ b/src/rrd_open.c @@ -1,10 +1,13 @@ /***************************************************************************** - * RRDtool 1.1.x Copyright Tobias Oetiker, 1997 - 2002 + * RRDtool 1.2rc9 Copyright by Tobi Oetiker, 1997-2005 ***************************************************************************** * rrd_open.c Open an RRD File ***************************************************************************** * $Id$ * $Log$ + * Revision 1.10 2004/05/26 22:11:12 oetiker + * reduce compiler warnings. Many small fixes. -- Mike Slifcak + * * Revision 1.9 2003/04/29 21:56:49 oetiker * readline in rrd_open.c reads the file in 8 KB blocks, and calls realloc for * each block. realloc is very slow in Mac OS X for huge blocks, e.g. when @@ -66,7 +69,7 @@ /* positioned to the first cdp in the first rra */ int -rrd_open(char *file_name, FILE **in_file, rrd_t *rrd, int rdwr) +rrd_open(const char *file_name, FILE **in_file, rrd_t *rrd, int rdwr) { @@ -75,13 +78,13 @@ rrd_open(char *file_name, FILE **in_file, rrd_t *rrd, int rdwr) rrd_init(rrd); if (rdwr == RRD_READONLY) { -#ifndef WIN32 +#if defined(WIN32) && !defined(__CYGWIN__) && !defined(__CYGWIN32__) mode = "r"; #else mode = "rb"; #endif } else { -#ifndef WIN32 +#if defined(WIN32) && !defined(__CYGWIN__) && !defined(__CYGWIN32__) mode = "r+"; #else mode = "rb+"; @@ -190,7 +193,7 @@ void rrd_freemem(void *mem) if (mem) free(mem); } -int readfile(char *file_name, char **buffer, int skipfirst){ +int readfile(const char *file_name, char **buffer, int skipfirst){ long writecnt=0,totalcnt = MEMBLK; long offset = 0; FILE *input=NULL;