Skip to content
Snippets Groups Projects
Commit d5f4df72 authored by Fujii Masao's avatar Fujii Masao
Browse files

Fix bug in the test of file descriptor of current WAL file in pg_receivexlog.

In pg_receivexlog, in order to check whether the current WAL file is
being opened or not, its file descriptor has to be checked against -1
as an invalid value. But, oops, 7900e94f added the incorrect test
checking the descriptor against 1. This commit fixes that bug.

Back-patch to 9.4 where the bug was added.

Spotted by Magnus Hagander
parent f66c20b3
No related branches found
No related tags found
No related merge requests found
...@@ -1021,7 +1021,7 @@ ProcessKeepaliveMsg(PGconn *conn, char *copybuf, int len, ...@@ -1021,7 +1021,7 @@ ProcessKeepaliveMsg(PGconn *conn, char *copybuf, int len,
if (replyRequested && still_sending) if (replyRequested && still_sending)
{ {
if (reportFlushPosition && lastFlushPosition < blockpos && if (reportFlushPosition && lastFlushPosition < blockpos &&
walfile != 1) walfile != -1)
{ {
/* /*
* If a valid flush location needs to be reported, * If a valid flush location needs to be reported,
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment