diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-17 07:45:40 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-17 07:45:40 +0000 |
commit | 07d7f4cfa4b10de87a31b68191036ff446add675 (patch) | |
tree | 7162524d8aaf1aef62d2f4fa51f595ed113981ff /tools/cibadmin.c | |
parent | Adding upstream version 2.1.6. (diff) | |
download | pacemaker-upstream/2.1.7.tar.xz pacemaker-upstream/2.1.7.zip |
Adding upstream version 2.1.7.upstream/2.1.7
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to '')
-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) { |