diff --git a/src/bin/pg_dump/pg_backup_tar.c b/src/bin/pg_dump/pg_backup_tar.c index 0e547e83be..a6acd85f60 100644 --- a/src/bin/pg_dump/pg_backup_tar.c +++ b/src/bin/pg_dump/pg_backup_tar.c @@ -1085,11 +1085,13 @@ _tarAddFile(ArchiveHandle *AH, TAR_MEMBER *th) /* * Find file len & go back to start. */ - fseeko(tmp, 0, SEEK_END); + if (fseeko(tmp, 0, SEEK_END) != 0) + fatal("error during file seek: %m"); th->fileLen = ftello(tmp); if (th->fileLen < 0) fatal("could not determine seek position in archive file: %m"); - fseeko(tmp, 0, SEEK_SET); + if (fseeko(tmp, 0, SEEK_SET) != 0) + fatal("error during file seek: %m"); _tarWriteHeader(th);