diff options
author | Darren Tucker <dtucker@zip.com.au> | 2006-06-23 21:24:12 +1000 |
---|---|---|
committer | Darren Tucker <dtucker@zip.com.au> | 2006-06-23 21:24:12 +1000 |
commit | 9afe115f0ac738204d4edb66b9353a765826ae46 (patch) | |
tree | d7ba646ed3ae0c4ff86e95542fa4174f6d43f45d /serverloop.c | |
parent | 3eb4834489426bd796da90299b2f8174b744dddd (diff) | |
download | openssh-git-9afe115f0ac738204d4edb66b9353a765826ae46.tar.gz |
- (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 'serverloop.c')
-rw-r--r-- | serverloop.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/serverloop.c b/serverloop.c index 021ba68c..c1eb2885 100644 --- a/serverloop.c +++ b/serverloop.c @@ -387,10 +387,15 @@ process_input(fd_set *readset) /* Read and buffer any available stdout data from the program. */ if (!fdout_eof && FD_ISSET(fdout, readset)) { + errno = 0; len = read(fdout, buf, sizeof(buf)); if (len < 0 && (errno == EINTR || errno == EAGAIN)) { /* do nothing */ +#ifdef PTY_ZEROREAD } else if (len <= 0) { +#else + } else if (len < 0 || (len == 0 && errno != 0)) { +#endif fdout_eof = 1; } else { buffer_append(&stdout_buffer, buf, len); @@ -399,10 +404,15 @@ process_input(fd_set *readset) } /* Read and buffer any available stderr data from the program. */ if (!fderr_eof && FD_ISSET(fderr, readset)) { + errno = 0; len = read(fderr, buf, sizeof(buf)); if (len < 0 && (errno == EINTR || errno == EAGAIN)) { /* do nothing */ +#ifdef PTY_ZEROREAD } else if (len <= 0) { +#else + } else if (len < 0 || (len == 0 && errno != 0)) { +#endif fderr_eof = 1; } else { buffer_append(&stderr_buffer, buf, len); |