From d43709bf9084effe9217df83d43b75a82a749c5d Mon Sep 17 00:00:00 2001 From: Arthur Zakirov Date: Mon, 24 Apr 2017 15:32:14 +0300 Subject: [PATCH] Fix fseek() result check --- data.c | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/data.c b/data.c index b54062a8..4b7bb1a3 100644 --- a/data.c +++ b/data.c @@ -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);