diff options
Diffstat (limited to 'tools/cibadmin.c')
-rw-r--r-- | tools/cibadmin.c | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/tools/cibadmin.c b/tools/cibadmin.c index f80afae..44488b5 100644 --- a/tools/cibadmin.c +++ b/tools/cibadmin.c @@ -72,8 +72,6 @@ void cibadmin_op_callback(xmlNode *msg, int call_id, int rc, xmlNode *output, static void print_xml_output(xmlNode * xml) { - char *buffer; - if (!xml) { return; } else if (xml->type != XML_ELEMENT_NODE) { @@ -95,8 +93,8 @@ print_xml_output(xmlNode * xml) } } else { - buffer = dump_xml_formatted(xml); - fprintf(stdout, "%s", pcmk__s(buffer, "<null>\n")); + char *buffer = dump_xml_formatted(xml); + fprintf(stdout, "%s", buffer); free(buffer); } } @@ -574,7 +572,7 @@ main(int argc, char **argv) output = createEmptyCib(1); crm_xml_add(output, XML_ATTR_VALIDATION, options.validate_with); buf = dump_xml_formatted(output); - fprintf(stdout, "%s", pcmk__s(buf, "<null>\n")); + fprintf(stdout, "%s", buf); free(buf); goto done; } @@ -726,7 +724,7 @@ main(int argc, char **argv) goto done; } - if (strcmp(options.cib_action, "md5-sum") == 0) { + if (pcmk__str_eq(options.cib_action, "md5-sum", pcmk__str_casei)) { char *digest = NULL; if (input == NULL) { @@ -885,7 +883,7 @@ do_work(xmlNode *input, xmlNode **output) /* construct the request */ the_cib->call_timeout = options.message_timeout_sec; if ((strcmp(options.cib_action, PCMK__CIB_REQUEST_REPLACE) == 0) - && pcmk__str_eq(crm_element_name(input), XML_TAG_CIB, pcmk__str_casei)) { + && pcmk__xe_is(input, XML_TAG_CIB)) { xmlNode *status = pcmk_find_cib_element(input, XML_CIB_TAG_STATUS); if (status == NULL) { |