diff -ur openssh/channels.c openssh.local/channels.c
--- openssh/channels.c	Thu Jul  4 19:11:10 2002
+++ openssh.local/channels.c	Fri Jul  5 13:58:27 2002
@@ -1278,12 +1278,13 @@
 	    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 && isatty(c->wfd) && 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) {
