From: Guus Sliepen Date: Fri, 5 Jan 2007 05:44:01 +0000 (+0000) Subject: rename() cannot replace existing files on Windows. X-Git-Tag: import-tinc-1.1~682 X-Git-Url: https://git.meshlink.io/?a=commitdiff_plain;h=d80cc7a5cc918a1dbf8dd789d2125f55c4949d27;p=meshlink 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); }