[ovs-dev] [PATCH 2/2] unixctl: Use absolute paths on Windows too.
Ben Pfaff
blp at ovn.org
Tue Jul 24 16:59:46 UTC 2018
When this case was adapted for Windows, asb_file_name() simply didn't work
at all there. Now, it should work OK, and it seems like the right thing
to do, and it makes the code more straightforward too.
CC: Alin Gabriel Serdean <aserdean at ovn.org>
Signed-off-by: Ben Pfaff <blp at ovn.org>
---
lib/unixctl.c | 13 ++-----------
1 file changed, 2 insertions(+), 11 deletions(-)
diff --git a/lib/unixctl.c b/lib/unixctl.c
index df9c2bdc3e07..bd9c1caeedef 100644
--- a/lib/unixctl.c
+++ b/lib/unixctl.c
@@ -228,11 +228,7 @@ unixctl_server_create(const char *path, struct unixctl_server **serverp)
if (path) {
char *abs_path;
-#ifndef _WIN32
abs_path = abs_file_name(ovs_rundir(), path);
-#else
- abs_path = xstrdup(path);
-#endif
punix_path = xasprintf("punix:%s", abs_path);
free(abs_path);
} else {
@@ -451,16 +447,11 @@ unixctl_server_destroy(struct unixctl_server *server)
int
unixctl_client_create(const char *path, struct jsonrpc **client)
{
- char *abs_path, *unix_path;
struct stream *stream;
int error;
-#ifdef _WIN32
- abs_path = xstrdup(path);
-#else
- abs_path = abs_file_name(ovs_rundir(), path);
-#endif
- unix_path = xasprintf("unix:%s", abs_path);
+ char *abs_path = abs_file_name(ovs_rundir(), path);
+ char *unix_path = xasprintf("unix:%s", abs_path);
*client = NULL;
--
2.16.1
More information about the dev
mailing list