From 10c119c3113a125877d381a3be52e80c1bfe26a5 Mon Sep 17 00:00:00 2001 From: Gurucharan Shetty Date: Mon, 16 Jun 2014 15:49:06 -0700 Subject: ovsdb-tool: Workaround inability to replace existing file on Windows. rename() on an existing destination file fails on Windows. This commit worksaround that problem. There are two tests that test it. But both of them use the ovsdb-server's --run option for the test and it does not exist in Windows. So change the test to workaround the lack of that feature. Signed-off-by: Gurucharan Shetty Acked-by: Ben Pfaff --- ovsdb/ovsdb-tool.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'ovsdb/ovsdb-tool.c') diff --git a/ovsdb/ovsdb-tool.c b/ovsdb/ovsdb-tool.c index 2ae782eba..e2a30ea72 100644 --- a/ovsdb/ovsdb-tool.c +++ b/ovsdb/ovsdb-tool.c @@ -249,6 +249,9 @@ compact_or_convert(const char *src_name_, const char *dst_name_, /* Replace source. */ if (in_place) { +#ifdef _WIN32 + unlink(src_name); +#endif if (rename(dst_name, src_name)) { ovs_fatal(errno, "failed to rename \"%s\" to \"%s\"", dst_name, src_name); -- cgit v1.2.1