Date: Tue, 23 Dec 2014 12:44:17 +0000 (UTC) From: Alexander Motin <mav@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r276138 - stable/10/usr.sbin/ctladm Message-ID: <201412231244.sBNCiHH2008621@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: mav Date: Tue Dec 23 12:44:16 2014 New Revision: 276138 URL: https://svnweb.freebsd.org/changeset/base/276138 Log: MFC r275958: Report XML parsing errors. Modified: stable/10/usr.sbin/ctladm/ctladm.c Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.sbin/ctladm/ctladm.c ============================================================================== --- stable/10/usr.sbin/ctladm/ctladm.c Tue Dec 23 12:41:28 2014 (r276137) +++ stable/10/usr.sbin/ctladm/ctladm.c Tue Dec 23 12:44:16 2014 (r276138) @@ -3643,11 +3643,14 @@ retry: XML_SetCharacterDataHandler(parser, cctl_islist_char_handler); retval = XML_Parse(parser, conn_str, strlen(conn_str), 1); - XML_ParserFree(parser); if (retval != 1) { + warnx("%s: Unable to parse XML: Error %d", __func__, + XML_GetErrorCode(parser)); + XML_ParserFree(parser); retval = 1; goto bailout; } + XML_ParserFree(parser); if (verbose != 0) { STAILQ_FOREACH(conn, &islist.conn_list, links) { @@ -4058,11 +4061,14 @@ retry: XML_SetCharacterDataHandler(parser, cctl_char_handler); retval = XML_Parse(parser, lun_str, strlen(lun_str), 1); - XML_ParserFree(parser); if (retval != 1) { + warnx("%s: Unable to parse XML: Error %d", __func__, + XML_GetErrorCode(parser)); + XML_ParserFree(parser); retval = 1; goto bailout; } + XML_ParserFree(parser); printf("LUN Backend %18s %4s %-16s %-16s\n", "Size (Blocks)", "BS", "Serial Number", "Device ID"); @@ -4336,11 +4342,14 @@ retry: XML_SetCharacterDataHandler(parser, cctl_char_phandler); retval = XML_Parse(parser, port_str, strlen(port_str), 1); - XML_ParserFree(parser); if (retval != 1) { + warnx("%s: Unable to parse XML: Error %d", __func__, + XML_GetErrorCode(parser)); + XML_ParserFree(parser); retval = 1; goto bailout; } + XML_ParserFree(parser); if (quiet == 0) printf("Port Online Frontend Name pp vp\n");
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201412231244.sBNCiHH2008621>