From 37353199483f2052b50e9d0b35257c27a08f3da4 Mon Sep 17 00:00:00 2001 From: Avra Sengupta Date: Wed, 5 Aug 2015 16:36:06 +0530 Subject: xml output: Fix non-uniform opErrstr xml output Display in case of no operrstr for all xml output of gluster commands. Change-Id: Ie16f749f90b4642357c562012408c434cd38661f BUG: 1245895 Signed-off-by: Avra Sengupta Reviewed-on: http://review.gluster.org/11835 Tested-by: Gluster Build System Reviewed-by: mohammed rafi kc Tested-by: NetBSD Build System Reviewed-by: Rajesh Joseph --- cli/src/cli-xml-output.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'cli/src/cli-xml-output.c') diff --git a/cli/src/cli-xml-output.c b/cli/src/cli-xml-output.c index d41aebc8cad..b558a9a843c 100644 --- a/cli/src/cli-xml-output.c +++ b/cli/src/cli-xml-output.c @@ -123,8 +123,15 @@ cli_xml_output_common (xmlTextWriterPtr writer, int op_ret, int op_errno, "%d", op_errno); XML_RET_CHECK_AND_GOTO (ret, out); - ret = xmlTextWriterWriteFormatElement (writer, (xmlChar *)"opErrstr", - "%s", op_errstr); + if (op_errstr) + ret = xmlTextWriterWriteFormatElement (writer, + (xmlChar *)"opErrstr", + "%s", op_errstr); + else + ret = xmlTextWriterWriteFormatElement (writer, + (xmlChar *)"opErrstr", + "%s", ""); + XML_RET_CHECK_AND_GOTO (ret, out); out: -- cgit