git.postgresql.org Git - postgresql.git/commitdiff

git projects / postgresql.git / commitdiff
? search:
summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 8198a32)
Focus on ftello result < 0 instead of errno
Sun, 9 Feb 2014 18:29:36 +0000 (13:29 -0500)
Sun, 9 Feb 2014 18:29:36 +0000 (13:29 -0500)
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.


diff --git a/src/bin/pg_dump/pg_backup_custom.c b/src/bin/pg_dump/pg_backup_custom.c
index a15254a118e83ba4b5f4e38df6e02e2dcf6f0778..72bdc3928b2b401e714d9a405982dab605787c74 100644 (file)
--- 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));
This is the main PostgreSQL git repository.
RSS Atom

AltStyle によって変換されたページ (->オリジナル) /