From 86849c088365d68d29ebc72813905309487dc8a9 Mon Sep 17 00:00:00 2001 From: Andreas Schneider Date: Mon, 14 Jan 2019 11:32:28 +0100 Subject: bind: Check for POLLRDHUP on the server if available MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This is a feature on modern Linux. Thanks to Ludovic Courtès for the pointer. Signed-off-by: Andreas Schneider --- src/bind.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'src/bind.c') diff --git a/src/bind.c b/src/bind.c index a91b3ad8..4e28f774 100644 --- a/src/bind.c +++ b/src/bind.c @@ -345,11 +345,18 @@ static int ssh_bind_poll_callback(ssh_poll_handle sshpoll, */ ssh_poll_handle ssh_bind_get_poll(ssh_bind sshbind) { + short events = POLLIN; + if (sshbind->poll) { return sshbind->poll; } + +#ifdef POLLRDHUP + events |= POLLRDHUP; +#endif /* POLLRDHUP */ + sshbind->poll = ssh_poll_new(sshbind->bindfd, - POLLIN, + events, ssh_bind_poll_callback, sshbind); -- cgit v1.2.3