Skip to content

Commit 78f91f1

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 7900e94 commit 78f91f1

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
@@ -919,7 +919,7 @@ HandleCopyStream(PGconn *conn, XLogRecPtr startpos, uint32 timeline,
919919
if (replyRequested && still_sending)
920920
{
921921
if (reportFlushPosition && lastFlushPosition < blockpos &&
922-
walfile != 1)
922+
walfile != -1)
923923
{
924924
/*
925925
* If a valid flush location needs to be reported,

0 commit comments

Comments
 (0)