diff options
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 |