From: oetiker Date: Sat, 30 Apr 2005 09:51:12 +0000 (+0000) Subject: always open with rb/wb when it is a binary file ... unix and windows will work alike... X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=012106294392f24e3fec3c7e4b7bc3f8634ad9e3;p=rrdtool-all.git always open with rb/wb when it is a binary file ... unix and windows will work alike with this ... git-svn-id: svn://svn.oetiker.ch/rrdtool/branches/1.2@455 a5681a0c-68f1-0310-ab6d-d61299d08faa --- diff --git a/program/src/rrd_open.c b/program/src/rrd_open.c index 98a52e00..a411ddf0 100644 --- a/program/src/rrd_open.c +++ b/program/src/rrd_open.c @@ -78,17 +78,9 @@ rrd_open(const char *file_name, FILE **in_file, rrd_t *rrd, int rdwr) rrd_init(rrd); if (rdwr == RRD_READONLY) { -#if defined(WIN32) mode = "rb"; -#else - mode = "r"; -#endif } else { -#if defined(WIN32) mode = "rb+"; -#else - mode = "r+"; -#endif } if (((*in_file) = fopen(file_name,mode)) == NULL ){ diff --git a/program/src/rrd_update.c b/program/src/rrd_update.c index df596667..a67a93a1 100644 --- a/program/src/rrd_update.c +++ b/program/src/rrd_update.c @@ -1383,11 +1383,7 @@ _rrd_update(char *filename, char *template, int argc, char **argv, * critical except during the burning cycles. */ if (schedule_smooth) { -#if defined(WIN32) && !defined(__CYGWIN__) && !defined(__CYGWIN32__) rrd_file = fopen(filename,"rb+"); -#else - rrd_file = fopen(filename,"r+"); -#endif rra_start = rra_begin; for (i = 0; i < rrd.stat_head -> rra_cnt; ++i) {