Fix a pg_dump scenario for platforms where SEEK_CUR != 1.
authorNoah Misch <noah@leadboat.com>
Tue, 3 Jun 2025 18:18:52 +0000 (11:18 -0700)
committerNoah Misch <noah@leadboat.com>
Tue, 3 Jun 2025 18:18:52 +0000 (11:18 -0700)
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

index 175fe9c427395d1ff7f6544922b828f035f7ef4d..197c1295d93fd202588a85c6163c14ea879a1a02 100644 (file)
@@ -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)