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 /lib/common/strings.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 'lib/common/strings.c')
-rw-r--r-- | lib/common/strings.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/lib/common/strings.c b/lib/common/strings.c index b245102..d9d2fda 100644 --- a/lib/common/strings.c +++ b/lib/common/strings.c @@ -417,10 +417,7 @@ crm_is_true(const char *s) { gboolean ret = FALSE; - if (s != NULL) { - crm_str_to_boolean(s, &ret); - } - return ret; + return (crm_str_to_boolean(s, &ret) < 0)? FALSE : ret; } int @@ -768,12 +765,15 @@ pcmk__compress(const char *data, unsigned int length, unsigned int max, *result_len = max; rc = BZ2_bzBuffToBuffCompress(compressed, result_len, uncompressed, length, CRM_BZ2_BLOCKS, 0, CRM_BZ2_WORK); + rc = pcmk__bzlib2rc(rc); + free(uncompressed); - if (rc != BZ_OK) { - crm_err("Compression of %d bytes failed: %s " CRM_XS " bzerror=%d", - length, bz2_strerror(rc), rc); + + if (rc != pcmk_rc_ok) { + crm_err("Compression of %d bytes failed: %s " CRM_XS " rc=%d", + length, pcmk_rc_str(rc), rc); free(compressed); - return pcmk_rc_error; + return rc; } #ifdef CLOCK_MONOTONIC |