rename() cannot replace existing files on Windows.
[tinc] / src / graph.c
index be6080e..1f00660 100644 (file)
@@ -374,6 +374,9 @@ void dump_graph(void)
                pclose(file);
        } else {
                fclose(file);
+#ifdef HAVE_MINGW
+               unlink(filename);
+#endif
                rename(tmpname, filename);
                free(tmpname);
        }