From: Jérémie Galarneau Date: Mon, 29 Feb 2016 19:23:19 +0000 (-0500) Subject: Fix: libxml2 may return 0 because of buffering X-Git-Tag: v2.8.0-rc1~135 X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=28676a1d553d82f961ac83147097c53dd8a401d2;p=lttng-tools.git Fix: libxml2 may return 0 because of buffering Signed-off-by: Jérémie Galarneau --- diff --git a/src/common/config/session-config.c b/src/common/config/session-config.c index 8fcb75230..11e0dcc4e 100644 --- a/src/common/config/session-config.c +++ b/src/common/config/session-config.c @@ -455,7 +455,7 @@ int config_writer_open_element(struct config_writer *writer, ret = xmlTextWriterStartElement(writer->writer, encoded_element_name); xmlFree(encoded_element_name); end: - return ret > 0 ? 0 : ret; + return ret >= 0 ? 0 : ret; } LTTNG_HIDDEN @@ -470,7 +470,7 @@ int config_writer_close_element(struct config_writer *writer) ret = xmlTextWriterEndElement(writer->writer); end: - return ret > 0 ? 0 : ret; + return ret >= 0 ? 0 : ret; } LTTNG_HIDDEN @@ -495,7 +495,7 @@ int config_writer_write_element_unsigned_int(struct config_writer *writer, encoded_element_name, "%" PRIu64, value); xmlFree(encoded_element_name); end: - return ret > 0 ? 0 : ret; + return ret >= 0 ? 0 : ret; } LTTNG_HIDDEN @@ -520,7 +520,7 @@ int config_writer_write_element_signed_int(struct config_writer *writer, encoded_element_name, "%" PRIi64, value); xmlFree(encoded_element_name); end: - return ret > 0 ? 0 : ret; + return ret >= 0 ? 0 : ret; } LTTNG_HIDDEN @@ -562,7 +562,7 @@ int config_writer_write_element_string(struct config_writer *writer, end: xmlFree(encoded_element_name); xmlFree(encoded_value); - return ret > 0 ? 0 : ret; + return ret >= 0 ? 0 : ret; } static