From: Tobias Oetiker Date: Wed, 22 Apr 2015 11:39:54 +0000 (+0200) Subject: fix for #611 ... try to unlink before rename ... X-Git-Tag: v1.5.1~1 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=cd5cc07eab4ab3abec29bd92213ebb3cca1ce75c;p=thirdparty%2Frrdtool-1.x.git fix for #611 ... try to unlink before rename ... --- diff --git a/src/rrd_create.c b/src/rrd_create.c index 8bc57244..66480a26 100644 --- a/src/rrd_create.c +++ b/src/rrd_create.c @@ -1391,7 +1391,11 @@ int write_rrd(const char *outfilename, rrd_t *out) { rrdc_forget(outfilename); rrd_clear_error(); } - + +#ifdef WIN32 +/* in windows, renaming to an existing file is verboten */ + unlink(outfilename); +#endif if (rename(tmpfilename, outfilename) != 0) { rrd_set_error("Cannot rename temporary file to final file!"); goto done;