diff --git a/src/bin/pg_basebackup/pg_recvlogical.c b/src/bin/pg_basebackup/pg_recvlogical.c
index a631cee..5ebf197 100644
--- a/src/bin/pg_basebackup/pg_recvlogical.c
+++ b/src/bin/pg_basebackup/pg_recvlogical.c
@@ -321,6 +321,9 @@ StreamLog(void)
 			FD_ZERO(&input_mask);
 			FD_SET(PQsocket(conn), &input_mask);
 
+			/* no timeout for select() if both -F and -s are disabled */
+			timeoutptr = NULL;
+
 			/* Compute when we need to wakeup to send a keepalive message. */
 			if (standby_message_timeout)
 				message_target = last_status + (standby_message_timeout - 1) *
