From: Magnus Hagander Date: Sun, 23 Oct 2016 14:00:42 +0000 (+0200) Subject: Fix walmethods.c build without libz X-Git-Tag: REL_10_BETA1~1523 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=9ae6713cdf32122fa5a0bf15ddcd85f78f6f4631;p=postgresql Fix walmethods.c build without libz Per numerous buildfarm manuals --- diff --git a/src/bin/pg_basebackup/walmethods.c b/src/bin/pg_basebackup/walmethods.c index e0ec752bbd..d28913fa69 100644 --- a/src/bin/pg_basebackup/walmethods.c +++ b/src/bin/pg_basebackup/walmethods.c @@ -416,6 +416,9 @@ tar_write(Walfile f, const void *buf, size_t count) return count; } #endif + else + /* Can't happen - compression enabled with no libz */ + return -1; } static bool @@ -879,8 +882,10 @@ CreateWalTarMethod(const char *tarbase, int compression, bool sync) tar_data->fd = -1; tar_data->compression = compression; tar_data->sync = sync; +#ifdef HAVE_LIBZ if (compression) tar_data->zlibOut = (char *) pg_malloc(ZLIB_OUT_SIZE + 1); +#endif return method; }