From bd94f6a1cc26fbcf8811e04dab0c90257b44d89a Mon Sep 17 00:00:00 2001 From: Kaushal M Date: Mon, 27 Feb 2012 15:34:11 +0530 Subject: cli: Fix broken "volume set help/help-xml" Change-Id: I4e71e67f32ff37cfe23bc77c0e27645ac495a247 BUG: 796040 Signed-off-by: Kaushal M Reviewed-on: http://review.gluster.com/2822 Tested-by: Gluster Build System Reviewed-by: Vijay Bellur --- cli/src/cli-rpc-ops.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'cli') diff --git a/cli/src/cli-rpc-ops.c b/cli/src/cli-rpc-ops.c index 5dfdbe063f5..995526abbea 100644 --- a/cli/src/cli-rpc-ops.c +++ b/cli/src/cli-rpc-ops.c @@ -1265,11 +1265,9 @@ gf_cli3_1_set_volume_cbk (struct rpc_req *req, struct iovec *iov, if (dict_get_str (dict, "help-str", &help_str)) snprintf (msg, sizeof (msg), "Set volume %s", (rsp.op_ret) ? "unsuccessful": "successful"); - else - snprintf (msg, sizeof (msg), "%s", help_str); #if (HAVE_LIB_XML) - if (global_state->mode & GLUSTER_MODE_XML) { + if ((global_state->mode & GLUSTER_MODE_XML) && (help_str == NULL)) { ret = cli_xml_output_str ("volSet", msg, rsp.op_ret, rsp.op_errno, rsp.op_errstr); if (ret) @@ -1279,7 +1277,8 @@ gf_cli3_1_set_volume_cbk (struct rpc_req *req, struct iovec *iov, } #endif - cli_out ("%s", msg); + cli_out ("%s", ((help_str == NULL) ? msg : help_str)); + ret = rsp.op_ret; out: -- cgit