diff options
author | Damien Miller <djm@mindrot.org> | 2022-01-22 11:38:21 +1100 |
---|---|---|
committer | Damien Miller <djm@mindrot.org> | 2022-01-22 11:38:21 +1100 |
commit | e204b34337a965feb439826157c191919fd9ecf8 (patch) | |
tree | 0ecfb26b6f7842683a938009be40505fd15b3b6c /channels.c | |
parent | 68085066b6bad43643b43f5957fcc5fd34782ccd (diff) |
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
Diffstat (limited to 'channels.c')
-rw-r--r-- | channels.c | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -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)); |