Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit d5f4df7

Browse files
committed
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, 7900e94 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
1 parent f66c20b commit d5f4df7

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/bin/pg_basebackup/receivelog.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1021,7 +1021,7 @@ ProcessKeepaliveMsg(PGconn *conn, char *copybuf, int len,
10211021
if (replyRequested && still_sending)
10221022
{
10231023
if (reportFlushPosition && lastFlushPosition < blockpos &&
1024-
walfile != 1)
1024+
walfile != -1)
10251025
{
10261026
/*
10271027
* If a valid flush location needs to be reported,

0 commit comments

Comments
 (0)