From: Guus Sliepen Date: Fri, 5 Jan 2007 05:44:01 +0000 (+0000) Subject: rename() cannot replace existing files on Windows. X-Git-Tag: release-1.0.7~3 X-Git-Url: https://tinc-vpn.org/git/browse?p=tinc;a=commitdiff_plain;h=d80cc7a5cc918a1dbf8dd789d2125f55c4949d27;hp=5214ece03009a916159c710cf436af1e92909f41 rename() cannot replace existing files on Windows. --- diff --git a/src/graph.c b/src/graph.c index be6080e0..1f006606 100644 --- a/src/graph.c +++ b/src/graph.c @@ -374,6 +374,9 @@ void dump_graph(void) pclose(file); } else { fclose(file); +#ifdef HAVE_MINGW + unlink(filename); +#endif rename(tmpname, filename); free(tmpname); }