[openssh-commits] [openssh] 01/01: restore tty force-read hack

git+noreply at mindrot.org git+noreply at mindrot.org
Sat Jan 22 11:40:35 AEDT 2022


This is an automated email from the git hooks/post-receive script.

djm pushed a commit to branch master
in repository openssh.

commit e204b34337a965feb439826157c191919fd9ecf8
Author: Damien Miller <djm at mindrot.org>
Date:   Sat Jan 22 11:38:21 2022 +1100

    restore tty force-read hack
    
    This portable-specific hack fixes a hang on exit for ttyful sessions
    on Linux and some SysVish Unix variants. It was accidentally disabled
    in commit 5c79952dfe1a (a precursor to the mainloop poll(2) conversion).
    
    Spotted by John in bz3383
---
 channels.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/channels.c b/channels.c
index 8281e5d3..dbfec7c0 100644
--- a/channels.c
+++ b/channels.c
@@ -1922,7 +1922,7 @@ channel_handle_rfd(struct ssh *ssh, Channel *c)
 
 	force = c->isatty && c->detach_close && c->istate != CHAN_INPUT_CLOSED;
 
-	if ((c->io_ready & SSH_CHAN_IO_RFD) == 0)
+	if (!force && (c->io_ready & SSH_CHAN_IO_RFD) == 0)
 		return 1;
 
 	errno = 0;
@@ -2087,7 +2087,7 @@ channel_handle_efd_read(struct ssh *ssh, Channel *c)
 
 	force = c->isatty && c->detach_close && c->istate != CHAN_INPUT_CLOSED;
 
-	if ((c->io_ready & SSH_CHAN_IO_EFD_R) == 0)
+	if (!force && (c->io_ready & SSH_CHAN_IO_EFD_R) == 0)
 		return 1;
 
 	len = read(c->efd, buf, sizeof(buf));

-- 
To stop receiving notification emails like this one, please contact
djm at mindrot.org.


More information about the openssh-commits mailing list