diff options
author | Andreas Schneider <asn@cryptomilk.org> | 2019-01-14 11:32:28 +0100 |
---|---|---|
committer | Andreas Schneider <asn@cryptomilk.org> | 2019-01-15 15:44:50 +0100 |
commit | 86849c088365d68d29ebc72813905309487dc8a9 (patch) | |
tree | b95d8f8beb52b2941f1afecb1e74d4922362c64b /src/bind.c | |
parent | 0e9add9a89fef3db585c3a5d1f94fe1712318d67 (diff) | |
download | libssh-86849c088365d68d29ebc72813905309487dc8a9.tar.gz libssh-86849c088365d68d29ebc72813905309487dc8a9.tar.xz libssh-86849c088365d68d29ebc72813905309487dc8a9.zip |
bind: Check for POLLRDHUP on the server if available
This is a feature on modern Linux.
Thanks to Ludovic Courtès <ludo@gnu.org> for the pointer.
Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
Diffstat (limited to 'src/bind.c')
-rw-r--r-- | src/bind.c | 9 |
1 files changed, 8 insertions, 1 deletions
@@ -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); |