diff --git a/src/bin/pg_basebackup/walmethods.c b/src/bin/pg_basebackup/walmethods.c index a6d08c1..bc0790a 100644 --- a/src/bin/pg_basebackup/walmethods.c +++ b/src/bin/pg_basebackup/walmethods.c @@ -143,7 +143,7 @@ dir_open_for_write(const char *pathname, const char *temp_suffix, size_t pad_to_ #ifdef HAVE_LIBZ if (dir_data->compression_method == COMPRESSION_GZIP) { - gzfp = gzdopen(fd, "wb"); + gzfp = gzopen(tmppath, "wb"); if (gzfp == NULL) { dir_data->lasterrno = errno;