Re: pgsql: Minor pg_dump improvements

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Stephen Frost <sfrost(at)snowman(dot)net>
Cc: pgsql-committers(at)postgresql(dot)org
Subject: Re: pgsql: Minor pg_dump improvements
Date: 2014-02-09 17:24:26
Message-ID: 15960.1391966666@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers

Stephen Frost <sfrost(at)snowman(dot)net> writes:
> Minor pg_dump improvements

I'm pretty sure you broke _CloseArchive with this hunk:

@@ -708,6 +708,9 @@ _CloseArchive(ArchiveHandle *AH)
{
WriteHead(AH);
tpos = ftello(AH->FH);
+ if (tpos < 0 || errno)
+ exit_horribly(modulename, "could not determine seek position in archive file: %s\n",
+ strerror(errno));
WriteToc(AH);
ctx->dataStart = _getFilePos(AH, ctx);

There's no reason to assume errno is zero at entry, and in any case
it should not be necessary to test for anything except tpos < 0.

I'm not sure why _ReopenArchive is coded like it was; seems like
tpos < 0 should be a sufficient test there too, and we shouldn't have to
reset errno beforehand.

regards, tom lane

In response to

Responses

Browse pgsql-committers by date

  From Date Subject
Next Message Stephen Frost 2014-02-09 17:54:14 Re: pgsql: Minor pg_dump improvements
Previous Message Robert Haas 2014-02-09 13:33:59 Re: [HACKERS] Viability of text HISTORY/INSTALL/regression README files (was Re: [COMMITTERS] pgsql: Document a few more regression test hazards.)