Skip to content

Commit d43709b

Browse files
committed
Fix fseek() result check
1 parent 72c5d0d commit d43709b

File tree

1 file changed

+3
-9
lines changed

1 file changed

+3
-9
lines changed

data.c

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -73,15 +73,9 @@ backup_data_page(pgFile *file, XLogRecPtr prev_backup_start_lsn,
7373

7474
while(try_checksum--)
7575
{
76-
if (fseek(in, offset, SEEK_SET) != offset)
77-
{
78-
/* TODO Should we check specific error code here? */
79-
if (verbose)
80-
elog(WARNING, "File: %s, could not seek to block %u. "
81-
"Probably the file was truncated after backup start.",
82-
file->path, blknum);
83-
return;
84-
}
76+
if (fseek(in, offset, SEEK_SET) != 0)
77+
elog(ERROR, "File: %s, could not seek to block %u: %s",
78+
file->path, blknum, strerror(errno));
8579

8680
read_len = fread(&page, 1, BLCKSZ, in);
8781

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy