From 1d5b249310553c05e6ed1d647734d41be174e634 Mon Sep 17 00:00:00 2001 From: Alvaro Herrera Date: Wed, 6 Jun 2018 14:46:53 -0400 Subject: [PATCH] Fix function code in error report MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit This bug causes a lseek() failure to be reported as a "could not open" failure in the error message, muddling bug reports. I introduced this copy-and-pasteo in commit 78e122010422. Noticed while reviewing code for bug report #15221, from lily liang. In version 10 the affected function is only used by multixact.c and commit_ts, and only in corner-case circumstances, neither of which are involved in the reported bug (a pg_subtrans failure.) Author: Álvaro Herrera --- src/backend/access/transam/slru.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/backend/access/transam/slru.c b/src/backend/access/transam/slru.c index 77edc51e1c..e0d26b75cf 100644 --- a/src/backend/access/transam/slru.c +++ b/src/backend/access/transam/slru.c @@ -614,7 +614,7 @@ SimpleLruDoesPhysicalPageExist(SlruCtl ctl, int pageno) if ((endpos = lseek(fd, 0, SEEK_END)) < 0) { - slru_errcause = SLRU_OPEN_FAILED; + slru_errcause = SLRU_SEEK_FAILED; slru_errno = errno; SlruReportIOError(ctl, pageno, 0); } -- 2.40.0