From 060e82cdcdba86744d96415444ca28921156db00 Mon Sep 17 00:00:00 2001 From: Ben Pfaff Date: Tue, 24 Jul 2018 09:58:56 -0700 Subject: [PATCH] unixctl: Use absolute paths on Windows too. 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. Acked-by: Alin Gabriel Serdean Signed-off-by: Ben Pfaff --- lib/unixctl.c | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-) diff --git a/lib/unixctl.c b/lib/unixctl.c index df9c2bdc3..bd9c1caee 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.39.5