summaryrefslogtreecommitdiff
path: root/ovsdb/ovsdb-tool.c
diff options
context:
space:
mode:
authorGurucharan Shetty <gshetty@nicira.com>2014-06-16 15:49:06 -0700
committerGurucharan Shetty <gshetty@nicira.com>2014-06-26 16:58:36 -0700
commit10c119c3113a125877d381a3be52e80c1bfe26a5 (patch)
tree4f88ae0ac2e9ba73696de1d9521c3082ca9edbc5 /ovsdb/ovsdb-tool.c
parentbd270dc33b61b9e65dcb67a69314d2a042a717ed (diff)
downloadopenvswitch-10c119c3113a125877d381a3be52e80c1bfe26a5.tar.gz
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 <gshetty@nicira.com> Acked-by: Ben Pfaff <blp@nicira.com>
Diffstat (limited to 'ovsdb/ovsdb-tool.c')
-rw-r--r--ovsdb/ovsdb-tool.c3
1 files changed, 3 insertions, 0 deletions
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);