diff options
author | Robert Haas <rhaas@postgresql.org> | 2022-03-15 13:06:25 -0400 |
---|---|---|
committer | Robert Haas <rhaas@postgresql.org> | 2022-03-15 13:06:25 -0400 |
commit | 75eae090876f4d47bf6a1e1016627b75da612307 (patch) | |
tree | 55bd88228194696d5c1c6e25b2332a17148c978c /src/bin/pg_basebackup/walmethods.c | |
parent | 695f459f1713303ba33b76eeb866c6501dff6380 (diff) | |
download | postgresql-75eae090876f4d47bf6a1e1016627b75da612307.tar.gz postgresql-75eae090876f4d47bf6a1e1016627b75da612307.zip |
Change HAVE_LIBLZ4 and HAVE_LIBZSTD tests to USE_LZ4 and USE_ZSTD.
These tests were added recently, but older code tests USE_LZ4 rathr
than HAVE_LIBLZ4, so let's follow the established precedent. It
also seems more consistent with the intent of the configure tests,
since I think that the USE_* symbols are intended to correspond to
what the user requested, and the HAVE_* symbols to what configure
found while probing.
Discussion: http://postgr.es/m/CA+Tgmoap+hTD2-QNPJLH4tffeFE8MX5+xkbFKMU3FKBy=ZSNKA@mail.gmail.com
Diffstat (limited to 'src/bin/pg_basebackup/walmethods.c')
-rw-r--r-- | src/bin/pg_basebackup/walmethods.c | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/src/bin/pg_basebackup/walmethods.c b/src/bin/pg_basebackup/walmethods.c index a6d08c1270a..1e0ff760eba 100644 --- a/src/bin/pg_basebackup/walmethods.c +++ b/src/bin/pg_basebackup/walmethods.c @@ -18,7 +18,7 @@ #include <time.h> #include <unistd.h> -#ifdef HAVE_LIBLZ4 +#ifdef USE_LZ4 #include <lz4frame.h> #endif #ifdef HAVE_LIBZ @@ -70,7 +70,7 @@ typedef struct DirectoryMethodFile #ifdef HAVE_LIBZ gzFile gzfp; #endif -#ifdef HAVE_LIBLZ4 +#ifdef USE_LZ4 LZ4F_compressionContext_t ctx; size_t lz4bufsize; void *lz4buf; @@ -114,7 +114,7 @@ dir_open_for_write(const char *pathname, const char *temp_suffix, size_t pad_to_ #ifdef HAVE_LIBZ gzFile gzfp = NULL; #endif -#ifdef HAVE_LIBLZ4 +#ifdef USE_LZ4 LZ4F_compressionContext_t ctx = NULL; size_t lz4bufsize = 0; void *lz4buf = NULL; @@ -160,7 +160,7 @@ dir_open_for_write(const char *pathname, const char *temp_suffix, size_t pad_to_ } } #endif -#ifdef HAVE_LIBLZ4 +#ifdef USE_LZ4 if (dir_data->compression_method == COMPRESSION_LZ4) { size_t ctx_out; @@ -245,7 +245,7 @@ dir_open_for_write(const char *pathname, const char *temp_suffix, size_t pad_to_ gzclose(gzfp); else #endif -#ifdef HAVE_LIBLZ4 +#ifdef USE_LZ4 if (dir_data->compression_method == COMPRESSION_LZ4) { (void) LZ4F_compressEnd(ctx, lz4buf, lz4bufsize, NULL); @@ -265,7 +265,7 @@ dir_open_for_write(const char *pathname, const char *temp_suffix, size_t pad_to_ if (dir_data->compression_method == COMPRESSION_GZIP) f->gzfp = gzfp; #endif -#ifdef HAVE_LIBLZ4 +#ifdef USE_LZ4 if (dir_data->compression_method == COMPRESSION_LZ4) { f->ctx = ctx; @@ -306,7 +306,7 @@ dir_write(Walfile f, const void *buf, size_t count) } else #endif -#ifdef HAVE_LIBLZ4 +#ifdef USE_LZ4 if (dir_data->compression_method == COMPRESSION_LZ4) { size_t chunk; @@ -394,7 +394,7 @@ dir_close(Walfile f, WalCloseMethod method) } else #endif -#ifdef HAVE_LIBLZ4 +#ifdef USE_LZ4 if (dir_data->compression_method == COMPRESSION_LZ4) { size_t compressed; @@ -487,7 +487,7 @@ dir_close(Walfile f, WalCloseMethod method) if (r != 0) dir_data->lasterrno = errno; -#ifdef HAVE_LIBLZ4 +#ifdef USE_LZ4 pg_free(df->lz4buf); /* supports free on NULL */ LZ4F_freeCompressionContext(df->ctx); @@ -523,7 +523,7 @@ dir_sync(Walfile f) } } #endif -#ifdef HAVE_LIBLZ4 +#ifdef USE_LZ4 if (dir_data->compression_method == COMPRESSION_LZ4) { DirectoryMethodFile *df = (DirectoryMethodFile *) f; |