diff options
Diffstat (limited to 'src/bin/pg_basebackup/pg_basebackup.c')
-rw-r--r-- | src/bin/pg_basebackup/pg_basebackup.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/bin/pg_basebackup/pg_basebackup.c b/src/bin/pg_basebackup/pg_basebackup.c index 16d8929b238..fa2ce75ee3e 100644 --- a/src/bin/pg_basebackup/pg_basebackup.c +++ b/src/bin/pg_basebackup/pg_basebackup.c @@ -1262,10 +1262,11 @@ ReceiveTarFile(PGconn *conn, PGresult *res, int rownum) #ifdef HAVE_LIBZ if (state.ztarfile != NULL) { + errno = 0; /* in case gzclose() doesn't set it */ if (gzclose(state.ztarfile) != 0) { - pg_log_error("could not close compressed file \"%s\": %s", - state.filename, get_gz_error(state.ztarfile)); + pg_log_error("could not close compressed file \"%s\": %m", + state.filename); exit(1); } } |