mirror of
https://git.postgresql.org/git/postgresql.git
synced 2024-12-21 08:29:39 +08:00
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.
This commit is contained in:
parent
8198a321c9
commit
5e8e794e3b
@ -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));
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user