diff options
author | Peter Eisentraut <peter@eisentraut.org> | 2023-08-07 09:06:52 +0200 |
---|---|---|
committer | Peter Eisentraut <peter@eisentraut.org> | 2023-08-07 09:34:38 +0200 |
commit | 67c0ef9752ade6dc252a19be8d2259847d4eb78d (patch) | |
tree | befd5e6f1a42b22ca1e629199b6ed954e2c72024 /src/bin/pg_basebackup/walmethods.c | |
parent | fdd79d8992d600d38eecfab568b27f6d04e4dfb3 (diff) | |
download | postgresql-67c0ef9752ade6dc252a19be8d2259847d4eb78d.tar.gz postgresql-67c0ef9752ade6dc252a19be8d2259847d4eb78d.zip |
Improve const use in zlib-using code
If we define ZLIB_CONST before including zlib.h, zlib augments some
interfaces with const decorations. By doing that we can keep our own
interfaces cleaner and can remove some unconstify calls.
ZLIB_CONST was introduced in zlib 1.2.5.2 (17 Dec 2011). When
compiling with older zlib releases, you might now get compiler
warnings about discarding qualifiers.
CentOS 6 has zlib 1.2.3, but in 8e278b6576, we removed support for the
OpenSSL release in CentOS 6, so it seems ok to de-support the zlib
release in CentOS 6 as well.
Reviewed-by: Tristan Partin <tristan@neon.tech>
Discussion: https://www.postgresql.org/message-id/flat/33462926-bb1e-7cc9-8d92-d86318e8ed1d%40eisentraut.org
Diffstat (limited to 'src/bin/pg_basebackup/walmethods.c')
-rw-r--r-- | src/bin/pg_basebackup/walmethods.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/src/bin/pg_basebackup/walmethods.c b/src/bin/pg_basebackup/walmethods.c index d780c4055cd..2de11ce9b1c 100644 --- a/src/bin/pg_basebackup/walmethods.c +++ b/src/bin/pg_basebackup/walmethods.c @@ -705,7 +705,7 @@ typedef struct TarMethodData #ifdef HAVE_LIBZ static bool -tar_write_compressed_data(TarMethodData *tar_data, void *buf, size_t count, +tar_write_compressed_data(TarMethodData *tar_data, const void *buf, size_t count, bool flush) { tar_data->zp->next_in = buf; @@ -782,8 +782,7 @@ tar_write(Walfile *f, const void *buf, size_t count) #ifdef HAVE_LIBZ else if (f->wwmethod->compression_algorithm == PG_COMPRESSION_GZIP) { - if (!tar_write_compressed_data(tar_data, unconstify(void *, buf), - count, false)) + if (!tar_write_compressed_data(tar_data, buf, count, false)) return -1; f->currpos += count; return count; |