summaryrefslogtreecommitdiffstats
path: root/glusterfsd/src/glusterfsd-mgmt.c
diff options
context:
space:
mode:
Diffstat (limited to 'glusterfsd/src/glusterfsd-mgmt.c')
-rw-r--r--glusterfsd/src/glusterfsd-mgmt.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/glusterfsd/src/glusterfsd-mgmt.c b/glusterfsd/src/glusterfsd-mgmt.c
index e320f76833b..c1ab934d31f 100644
--- a/glusterfsd/src/glusterfsd-mgmt.c
+++ b/glusterfsd/src/glusterfsd-mgmt.c
@@ -2105,6 +2105,7 @@ glusterfs_mgmt_init (glusterfs_ctx_t *ctx)
char *host = NULL;
cmd_args = &ctx->cmd_args;
+ GF_VALIDATE_OR_GOTO (THIS->name, cmd_args->volfile_server, out);
if (ctx->mgmt)
return 0;
@@ -2112,11 +2113,14 @@ glusterfs_mgmt_init (glusterfs_ctx_t *ctx)
if (cmd_args->volfile_server_port)
port = cmd_args->volfile_server_port;
- host = "localhost";
- if (cmd_args->volfile_server)
- host = cmd_args->volfile_server;
+ host = cmd_args->volfile_server;
- ret = rpc_transport_inet_options_build (&options, host, port);
+ if (cmd_args->volfile_server_transport &&
+ !strcmp (cmd_args->volfile_server_transport, "unix")) {
+ ret = rpc_transport_unix_options_build (&options, host, 0);
+ } else {
+ ret = rpc_transport_inet_options_build (&options, host, port);
+ }
if (ret)
goto out;