]> git.ipfire.org Git - thirdparty/rrdtool-1.x.git/commitdiff
fix for #611 ... try to unlink before rename ...
authorTobias Oetiker <tobi@oetiker.ch>
Wed, 22 Apr 2015 11:39:54 +0000 (13:39 +0200)
committerTobias Oetiker <tobi@oetiker.ch>
Wed, 22 Apr 2015 11:39:54 +0000 (13:39 +0200)
src/rrd_create.c

index 8bc57244ac6d9e083f047fdbaaa3e3d08fef0e88..66480a261c0444b7487cf550aac975a64a898715 100644 (file)
@@ -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;