- (bal) AIX tty data limiting patch fix by leigh@solinno.co.uk
diff --git a/channels.c b/channels.c
index cf6742a..fe99cdb 100644
--- a/channels.c
+++ b/channels.c
@@ -186,6 +186,7 @@
} else {
c->isatty = 0;
}
+ c->wfd_isatty = isatty(c->wfd);
/* enable nonblocking mode */
if (nonblock) {
@@ -1286,12 +1287,12 @@
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) {