From 0e164eb9f43626dc9e31f4bae26eeb3e8422584a Mon Sep 17 00:00:00 2001 From: Noah Misch Date: Tue, 3 Jun 2025 11:18:52 -0700 Subject: [PATCH] Fix a pg_dump scenario for platforms where SEEK_CUR != 1. POSIX allows such platforms. Given the lack of complaints, we may not currently test on such a platform. This is new in v18 (commit 7d5c83b4e90c7156655f98b7312a30ae5eeb4d27), so no back-patch. --- src/bin/pg_dump/pg_backup_archiver.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/bin/pg_dump/pg_backup_archiver.c b/src/bin/pg_dump/pg_backup_archiver.c index 175fe9c4273..197c1295d93 100644 --- a/src/bin/pg_dump/pg_backup_archiver.c +++ b/src/bin/pg_dump/pg_backup_archiver.c @@ -2655,7 +2655,7 @@ WriteToc(ArchiveHandle *AH) pg_fatal("unexpected TOC entry in WriteToc(): %d %s %s", te->dumpId, te->desc, te->tag); - if (fseeko(AH->FH, te->defnLen, SEEK_CUR != 0)) + if (fseeko(AH->FH, te->defnLen, SEEK_CUR) != 0) pg_fatal("error during file seek: %m"); } else if (te->defnDumper)