diff options
author | Alexander Pyhalov <apyhalov@gmail.com> | 2016-05-31 19:41:01 +0300 |
---|---|---|
committer | Hans Rosenfeld <hans.rosenfeld@nexenta.com> | 2016-06-01 21:17:41 +0200 |
commit | 0687de4f0b1d84cc87ddf92c49ceaec0f551670e (patch) | |
tree | c2cc6a8a533280f6a59ee8de4c5893754225bb97 | |
parent | 1919e1f72d0a8141a10acd516bd1daa5064c8d07 (diff) | |
download | illumos-joyent-0687de4f0b1d84cc87ddf92c49ceaec0f551670e.tar.gz |
7018 illumos-gate build fails with libxml2 2.9.4
Reviewed by: Andy Stormont <astormont@racktopsystems.com>
Reviewed by: Dan McDonald <danmcd@omniti.com>
Reviewed by: Igor Kozhukhov <ikozhukhov@gmail.com>
Approved by: Hans Rosenfeld <rosenfeld@grumpf.hope-2000.org>
-rw-r--r-- | usr/src/cmd/isns/isnsadm/isnsadm.c | 8 | ||||
-rw-r--r-- | usr/src/cmd/isns/isnsd/door.c | 32 | ||||
-rw-r--r-- | usr/src/cmd/isns/isnsd/xml/data.c | 10 |
3 files changed, 34 insertions, 16 deletions
diff --git a/usr/src/cmd/isns/isnsadm/isnsadm.c b/usr/src/cmd/isns/isnsadm/isnsadm.c index 536643719f..52e78848fe 100644 --- a/usr/src/cmd/isns/isnsadm/isnsadm.c +++ b/usr/src/cmd/isns/isnsadm/isnsadm.c @@ -105,6 +105,12 @@ static int build_enumerate_xml_doc(object_type, xmlChar **); #define INITIATOR_ONLY 0x00000010 #define TARGET_ONLY 0x00000100 +#if LIBXML_VERSION >= 20904 +#define XMLSTRING_CAST (const char *) +#else +#define XMLSTRING_CAST (const xmlChar *) +#endif + /* object table based on definitions in isns_mgmt.h. */ static obj_table_entry_t obj_table[] = { {NODEOBJECT, Node}, @@ -455,7 +461,7 @@ print_partial_failure_info(xmlChar *doc) for (i = 0; obj_table[i].obj_str != NULL; i++) { (void) xmlStrPrintf(expr, ISNS_MAX_LABEL_LEN + 13, - (const unsigned char *)"%s\"%s\"]", "//*[name()=", + XMLSTRING_CAST "%s\"%s\"]", "//*[name()=", obj_table[i].obj_str); xpath_obj = xmlXPathEvalExpression(expr, ctext); if ((xpath_obj) && (xpath_obj->nodesetval) && diff --git a/usr/src/cmd/isns/isnsd/door.c b/usr/src/cmd/isns/isnsd/door.c index 01b27a5264..ef4995532d 100644 --- a/usr/src/cmd/isns/isnsd/door.c +++ b/usr/src/cmd/isns/isnsd/door.c @@ -68,6 +68,12 @@ extern boolean_t door_created; (object_attrlist_t **)realloc((object_attrlist_t *)old, \ (unsigned)(n+2) * sizeof (object_attrlist_t *)) +#if LIBXML_VERSION >= 20904 +#define XMLSTRING_CAST (const char *) +#else +#define XMLSTRING_CAST (const xmlChar *) +#endif + /* operation table */ static op_table_entry_t op_table[] = { {GET, get_op}, @@ -115,7 +121,7 @@ get_op_id_from_doc(xmlXPathContextPtr ctext) for (i = 0; op_table[i].op_str != NULL; i++) { (void) xmlStrPrintf(expr, ISNS_MAX_LABEL_LEN + 13, - (const unsigned char *)"%s\"%s\"]", "//*[name()=", + XMLSTRING_CAST "%s\"%s\"]", "//*[name()=", op_table[i].op_str); xpath_obj = xmlXPathEvalExpression(expr, ctext); if ((xpath_obj) && (xpath_obj->nodesetval) && @@ -159,7 +165,7 @@ process_get_request_from_doc(xmlXPathContextPtr ctext, request_t *req) isnslog(LOG_DEBUG, "process_get_request_from_doc", "entered"); (void) xmlStrPrintf(expr, ISNS_MAX_LABEL_LEN + 13, - (const unsigned char *)"%s\"%s\"]", "//*[name()=", ISNSOBJECT); + XMLSTRING_CAST "%s\"%s\"]", "//*[name()=", ISNSOBJECT); xpath_obj = xmlXPathEvalExpression(expr, ctext); if ((xpath_obj) && (xpath_obj->nodesetval) && (xpath_obj->nodesetval->nodeTab) && @@ -186,7 +192,7 @@ process_get_request_from_doc(xmlXPathContextPtr ctext, request_t *req) if (obj == 0) { /* check the server config request. */ (void) xmlStrPrintf(expr, ISNS_MAX_LABEL_LEN + 13, - (const unsigned char *)"%s\"%s\"]", "//*[name()=", ISNSSERVER); + XMLSTRING_CAST "%s\"%s\"]", "//*[name()=", ISNSSERVER); xpath_obj = xmlXPathEvalExpression(expr, ctext); if ((xpath_obj) && (xpath_obj->nodesetval) && (xpath_obj->nodesetval->nodeNr > 0) && @@ -213,7 +219,7 @@ process_get_request_from_doc(xmlXPathContextPtr ctext, request_t *req) } (void) xmlStrPrintf(expr, ISNS_MAX_LABEL_LEN + 12, - (const unsigned char *)"%s\"%s\"]", "//*[name()=", + XMLSTRING_CAST "%s\"%s\"]", "//*[name()=", obj_table[i].obj_str); xpath_obj = xmlXPathEvalExpression(expr, ctext); if (((xpath_obj == NULL) || (xpath_obj->nodesetval == NULL) || @@ -284,7 +290,7 @@ process_enumerate_request_from_doc(xmlXPathContextPtr ctext, request_t *req) isnslog(LOG_DEBUG, "process_enumerate_request_from_doc", "entered"); (void) xmlStrPrintf(expr, ISNS_MAX_LABEL_LEN + 13, - (const unsigned char *)"%s\"%s\"]", "//*[name()=", ISNSOBJECTTYPE); + XMLSTRING_CAST "%s\"%s\"]", "//*[name()=", ISNSOBJECTTYPE); xpath_obj = xmlXPathEvalExpression(expr, ctext); isnslog(LOG_DEBUG, "process_enumerate_request_from_doc", "xpath obj->nodesetval->nodeNR: %d", xpath_obj->nodesetval->nodeNr); @@ -345,7 +351,7 @@ process_getAssociated_request_from_doc(xmlXPathContextPtr ctext, request_t *req) isnslog(LOG_DEBUG, "process_getAssociated_request_from_doc", "entered"); (void) xmlStrPrintf(expr, ISNS_MAX_LABEL_LEN + 13, - (const unsigned char *)"%s\"%s\"]", "//*[name()=", ASSOCIATIONTYPE); + XMLSTRING_CAST "%s\"%s\"]", "//*[name()=", ASSOCIATIONTYPE); xpath_obj = xmlXPathEvalExpression(expr, ctext); if ((xpath_obj) && (xpath_obj->nodesetval) && (xpath_obj->nodesetval->nodeNr > 0) && @@ -378,7 +384,7 @@ process_getAssociated_request_from_doc(xmlXPathContextPtr ctext, request_t *req) /* using the same algorithm for isns object */ case DiscoveryDomainMember: (void) xmlStrPrintf(expr, ISNS_MAX_LABEL_LEN + 13, - (const unsigned char *)"%s\"%s\"]", "//*[name()=", NODEOBJECT); + XMLSTRING_CAST "%s\"%s\"]", "//*[name()=", NODEOBJECT); xpath_obj = xmlXPathEvalExpression(expr, ctext); r_nodes = xpath_obj->nodesetval; if ((xpath_obj) && (xpath_obj->nodesetval) && @@ -388,7 +394,7 @@ process_getAssociated_request_from_doc(xmlXPathContextPtr ctext, request_t *req) } else { if (xpath_obj) xmlXPathFreeObject(xpath_obj); (void) xmlStrPrintf(expr, ISNS_MAX_LABEL_LEN + 13, - (const unsigned char *)"%s\"%s\"]", "//*[name()=", + XMLSTRING_CAST "%s\"%s\"]", "//*[name()=", DDOBJECT); xpath_obj = xmlXPathEvalExpression(expr, ctext); r_nodes = xpath_obj->nodesetval; @@ -404,7 +410,7 @@ process_getAssociated_request_from_doc(xmlXPathContextPtr ctext, request_t *req) break; case DiscoveryDomainSetMember: (void) xmlStrPrintf(expr, ISNS_MAX_LABEL_LEN + 13, - (const unsigned char *)"%s\"%s\"]", "//*[name()=", DDSETOBJECT); + XMLSTRING_CAST "%s\"%s\"]", "//*[name()=", DDSETOBJECT); xpath_obj = xmlXPathEvalExpression(expr, ctext); r_nodes = xpath_obj->nodesetval; if ((xpath_obj) && (xpath_obj->nodesetval) && @@ -414,7 +420,7 @@ process_getAssociated_request_from_doc(xmlXPathContextPtr ctext, request_t *req) } else { if (xpath_obj) xmlXPathFreeObject(xpath_obj); (void) xmlStrPrintf(expr, ISNS_MAX_LABEL_LEN + 13, - (const unsigned char *)"%s\"%s\"]", "//*[name()=", + XMLSTRING_CAST "%s\"%s\"]", "//*[name()=", DDOBJECT); xpath_obj = xmlXPathEvalExpression(expr, ctext); r_nodes = xpath_obj->nodesetval; @@ -487,7 +493,7 @@ process_delete_request_from_doc(xmlXPathContextPtr ctext, request_t *req) isnslog(LOG_DEBUG, "process_delete_request_from_doc", "entered"); for (i = 0; obj_table[i].obj_str != NULL; i++) { (void) xmlStrPrintf(expr, ISNS_MAX_LABEL_LEN + 13, - (const unsigned char *)"%s\"%s\"]", "//*[name()=", + XMLSTRING_CAST "%s\"%s\"]", "//*[name()=", obj_table[i].obj_str); xpath_obj = xmlXPathEvalExpression(expr, ctext); if ((xpath_obj) && (xpath_obj->nodesetval) && @@ -677,7 +683,7 @@ process_createModify_request_from_doc(xmlXPathContextPtr ctext, request_t *req) isnslog(LOG_DEBUG, "process_createModify_request_from_doc", "entered"); for (i = 0; obj_table[i].obj_str != NULL; i++) { (void) xmlStrPrintf(expr, ISNS_MAX_LABEL_LEN + 13, - (const unsigned char *)"%s\"%s\"]", "//*[name()=", + XMLSTRING_CAST "%s\"%s\"]", "//*[name()=", obj_table[i].obj_str); xpath_obj = xmlXPathEvalExpression(expr, ctext); if ((xpath_obj) && (xpath_obj->nodesetval) && @@ -1099,7 +1105,7 @@ build_mgmt_response(xmlChar **response, request_t req, int *size) ctext = xmlXPathNewContext(doc); if (ctext != NULL) { (void) xmlStrPrintf(expr, ISNS_MAX_LABEL_LEN + 13, - (const unsigned char *)"%s\"%s\"]", "//*[name()=", RESULT); + XMLSTRING_CAST "%s\"%s\"]", "//*[name()=", RESULT); xpath_obj = xmlXPathEvalExpression(expr, ctext); if ((xpath_obj == NULL) || (xpath_obj->nodesetval == NULL) || (xpath_obj->nodesetval->nodeNr <= 0) || diff --git a/usr/src/cmd/isns/isnsd/xml/data.c b/usr/src/cmd/isns/isnsd/xml/data.c index cf3d4ac8a4..5887e81b45 100644 --- a/usr/src/cmd/isns/isnsd/xml/data.c +++ b/usr/src/cmd/isns/isnsd/xml/data.c @@ -43,6 +43,12 @@ #include "isns_obj.h" #include "isns_log.h" +#if LIBXML_VERSION >= 20904 +#define XMLSTRING_CAST (const char *) +#else +#define XMLSTRING_CAST (const xmlChar *) +#endif + /* * external variables */ @@ -362,7 +368,7 @@ convert_attr2xml( case 'u': /* 4-bytes non-negative integer */ if (xmlStrPrintf(buff, sizeof (buff), - (const unsigned char *)"%u", + XMLSTRING_CAST "%u", attr->value.ui) > 0) { value = (xmlChar *)&buff; } @@ -645,7 +651,7 @@ locate_xml_node( *context = xmlXPathNewContext(doc); if (*context && - xmlStrPrintf(&expr[2], 30, (const unsigned char *)"%s", + xmlStrPrintf(&expr[2], 30, XMLSTRING_CAST "%s", xmlTag[i]) != -1) { *result = xmlXPathEvalExpression(expr, *context); if (*result) { |