- (dtucker) [channels.c serverloop.c] Apply the bug #1102 workaround to ptys
only, otherwise sshd can hang exiting non-interactive sessions.
diff --git a/channels.c b/channels.c
index 239e9dd..9642a56 100644
--- a/channels.c
+++ b/channels.c
@@ -1422,7 +1422,8 @@
#ifndef PTY_ZEROREAD
if (len <= 0) {
#else
- if (len < 0 || (len == 0 && errno != 0)) {
+ if ((!c->isatty && len <= 0) ||
+ (c->isatty && (len < 0 || (len == 0 && errno != 0)))) {
#endif
debug2("channel %d: read<=0 rfd %d len %d",
c->self, c->rfd, len);