1
0
mirror of https://github.com/postgrespro/pg_probackup.git synced 2026-05-16 09:48:14 +02:00

Fix fseek() result check

This commit is contained in:
Arthur Zakirov
2017-04-24 15:32:14 +03:00
parent 72c5d0d115
commit d43709bf90
+3 -9
View File
@@ -73,15 +73,9 @@ backup_data_page(pgFile *file, XLogRecPtr prev_backup_start_lsn,
while(try_checksum--)
{
if (fseek(in, offset, SEEK_SET) != offset)
{
/* TODO Should we check specific error code here? */
if (verbose)
elog(WARNING, "File: %s, could not seek to block %u. "
"Probably the file was truncated after backup start.",
file->path, blknum);
return;
}
if (fseek(in, offset, SEEK_SET) != 0)
elog(ERROR, "File: %s, could not seek to block %u: %s",
file->path, blknum, strerror(errno));
read_len = fread(&page, 1, BLCKSZ, in);