aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorStephen Frost <sfrost@snowman.net>2014-02-09 13:29:36 -0500
committerStephen Frost <sfrost@snowman.net>2014-02-09 13:29:36 -0500
commit5e8e794e3be9fbeddf6f2e2c0515dd0f04c784ec (patch)
treef7242dd5bccb2772354c89a8187ca945082b439d /src
parent8198a321c9ea2072c5acde438f4d19638e04f6f2 (diff)
downloadpostgresql-5e8e794e3be9fbeddf6f2e2c0515dd0f04c784ec.tar.gz
postgresql-5e8e794e3be9fbeddf6f2e2c0515dd0f04c784ec.zip
Focus on ftello result < 0 instead of errno
Rather than reset errno (or just hope that its cleared already), check just the result of the ftello for < 0 to determine if there was an issue. Oversight by me, pointed out by Tom.
Diffstat (limited to 'src')
-rw-r--r--src/bin/pg_dump/pg_backup_custom.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/src/bin/pg_dump/pg_backup_custom.c b/src/bin/pg_dump/pg_backup_custom.c
index a15254a118e..72bdc3928b2 100644
--- a/src/bin/pg_dump/pg_backup_custom.c
+++ b/src/bin/pg_dump/pg_backup_custom.c
@@ -708,7 +708,7 @@ _CloseArchive(ArchiveHandle *AH)
{
WriteHead(AH);
tpos = ftello(AH->FH);
- if (tpos < 0 || errno)
+ if (tpos < 0)
exit_horribly(modulename, "could not determine seek position in archive file: %s\n",
strerror(errno));
WriteToc(AH);
@@ -757,9 +757,8 @@ _ReopenArchive(ArchiveHandle *AH)
if (!ctx->hasSeek)
exit_horribly(modulename, "parallel restore from non-seekable file is not supported\n");
- errno = 0;
tpos = ftello(AH->FH);
- if (tpos < 0 || errno)
+ if (tpos < 0)
exit_horribly(modulename, "could not determine seek position in archive file: %s\n",
strerror(errno));