X-Git-Url: https://git.verplant.org/?a=blobdiff_plain;f=src%2Frrd_restore.c;h=89f34c2753917f2d6a5e67eec1a1982ac6ecdb0c;hb=76cec77ec4d266dc3b9cfcac55adb76fa930bbaf;hp=2c9a280909df2645d73706538e67a22e3c23d221;hpb=8d7ffaec9843a341f375483477b6a82f1207d749;p=rrdtool.git diff --git a/src/rrd_restore.c b/src/rrd_restore.c index 2c9a280..89f34c2 100644 --- a/src/rrd_restore.c +++ b/src/rrd_restore.c @@ -415,7 +415,11 @@ rrd_write(char *file_name, rrd_t *rrd, char force_overwrite) if (strcmp("-",file_name)==0){ rrd_file= stdout; } else { - fdflags = O_WRONLY|O_CREAT; +#ifdef WIN32 + fdflags = O_RDWR|O_BINARY|O_CREAT|O_EXCL; +#else + fdflags = O_WRONLY|O_CREAT|O_EXCL; +#endif if (force_overwrite == 0) { fdflags |= O_EXCL; }