diff options
author | Gurucharan Shetty <gshetty@nicira.com> | 2014-06-16 15:49:06 -0700 |
---|---|---|
committer | Gurucharan Shetty <gshetty@nicira.com> | 2014-06-26 16:58:36 -0700 |
commit | 10c119c3113a125877d381a3be52e80c1bfe26a5 (patch) | |
tree | 4f88ae0ac2e9ba73696de1d9521c3082ca9edbc5 /ovsdb/ovsdb-tool.c | |
parent | bd270dc33b61b9e65dcb67a69314d2a042a717ed (diff) | |
download | openvswitch-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.c | 3 |
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); |