summaryrefslogtreecommitdiff
path: root/channels.c
diff options
context:
space:
mode:
authorBen Lindstrom <mouring@eviladmin.org>2002-07-22 15:28:53 +0000
committerBen Lindstrom <mouring@eviladmin.org>2002-07-22 15:28:53 +0000
commitbeb5f3304b74fe04a1fde815fe70ecf2f30e95b1 (patch)
treee0b47b7561930363b8f72f96a1fe3e07308e8f5a /channels.c
parent287077eaf2db7115a08f0fa9bd811ddda6119209 (diff)
- (bal) AIX tty data limiting patch fix by leigh@solinno.co.uk
Diffstat (limited to 'channels.c')
-rw-r--r--channels.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/channels.c b/channels.c
index cf6742ae..fe99cdbe 100644
--- a/channels.c
+++ b/channels.c
@@ -186,6 +186,7 @@ channel_register_fds(Channel *c, int rfd, int wfd, int efd,
} else {
c->isatty = 0;
}
+ c->wfd_isatty = isatty(c->wfd);
/* enable nonblocking mode */
if (nonblock) {
@@ -1286,12 +1287,12 @@ channel_handle_wfd(Channel *c, fd_set * readset, fd_set * writeset)
buffer_len(&c->output) > 0) {
data = buffer_ptr(&c->output);
dlen = buffer_len(&c->output);
- len = write(c->wfd, data, dlen);
#ifdef _AIX
/* XXX: Later AIX versions can't push as much data to tty */
- if (compat20 && c->isatty && dlen >= 8*1024)
+ if (compat20 && c->wfd_isatty && dlen > 8*1024)
dlen = 8*1024;
#endif
+ len = write(c->wfd, data, dlen);
if (len < 0 && (errno == EINTR || errno == EAGAIN))
return 1;
if (len <= 0) {