summaryrefslogtreecommitdiff
path: root/channels.c
diff options
context:
space:
mode:
authorDarren Tucker <dtucker@zip.com.au>2006-06-23 21:24:12 +1000
committerDarren Tucker <dtucker@zip.com.au>2006-06-23 21:24:12 +1000
commit9afe115f0ac738204d4edb66b9353a765826ae46 (patch)
treed7ba646ed3ae0c4ff86e95542fa4174f6d43f45d /channels.c
parent3eb4834489426bd796da90299b2f8174b744dddd (diff)
- (dtucker) [channels.c configure.ac serverloop.c] Bug #1102: Around AIX
4.3.3 ML3 or so, the AIX pty layer starting passing zero-length writes on the pty slave as zero-length reads on the pty master, which sshd interprets as the descriptor closing. Since most things don't do zero length writes this rarely matters, but occasionally it happens, and when it does the SSH pty session appears to hang, so we add a special case for this condition. ok djm@
Diffstat (limited to 'channels.c')
-rw-r--r--channels.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/channels.c b/channels.c
index 2fa997edc..239e9dd83 100644
--- a/channels.c
+++ b/channels.c
@@ -1415,10 +1415,15 @@ channel_handle_rfd(Channel *c, fd_set *readset, fd_set *writeset)
1415 1415
1416 if (c->rfd != -1 && 1416 if (c->rfd != -1 &&
1417 FD_ISSET(c->rfd, readset)) { 1417 FD_ISSET(c->rfd, readset)) {
1418 errno = 0;
1418 len = read(c->rfd, buf, sizeof(buf)); 1419 len = read(c->rfd, buf, sizeof(buf));
1419 if (len < 0 && (errno == EINTR || errno == EAGAIN)) 1420 if (len < 0 && (errno == EINTR || errno == EAGAIN))
1420 return 1; 1421 return 1;
1422#ifndef PTY_ZEROREAD
1421 if (len <= 0) { 1423 if (len <= 0) {
1424#else
1425 if (len < 0 || (len == 0 && errno != 0)) {
1426#endif
1422 debug2("channel %d: read<=0 rfd %d len %d", 1427 debug2("channel %d: read<=0 rfd %d len %d",
1423 c->self, c->rfd, len); 1428 c->self, c->rfd, len);
1424 if (c->type != SSH_CHANNEL_OPEN) { 1429 if (c->type != SSH_CHANNEL_OPEN) {