summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDamien Miller <djm@mindrot.org>2013-08-01 14:29:20 +1000
committerDamien Miller <djm@mindrot.org>2013-08-01 14:29:20 +1000
commitc192a4c4f6da907dc0e67a3ca61d806f9a92c931 (patch)
treec9ea84bd9379a08bb53ee8051a69c597cec8da15
parent81f7cf1ec5bc2fd202eda05abc2e5361c54633c5 (diff)
- (djm) [channels.c channels.h] bz#2135: On Solaris, isatty() on a non-
blocking connecting socket will clear any stored errno that might otherwise have been retrievable via getsockopt(). A hack to limit writes to TTYs on AIX was triggering this. Since only AIX needs the hack, wrap it in an #ifdef. Diagnosis and patch from Ivo Raisr.
-rw-r--r--ChangeLog7
-rw-r--r--channels.c3
-rw-r--r--channels.h2
3 files changed, 12 insertions, 0 deletions
diff --git a/ChangeLog b/ChangeLog
index b7a09812..3b79b5d2 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+20130801
+ - (djm) [channels.c channels.h] bz#2135: On Solaris, isatty() on a non-
+ blocking connecting socket will clear any stored errno that might
+ otherwise have been retrievable via getsockopt(). A hack to limit writes
+ to TTYs on AIX was triggering this. Since only AIX needs the hack, wrap
+ it in an #ifdef. Diagnosis and patch from Ivo Raisr.
+
20130725
- (djm) OpenBSD CVS Sync
- djm@cvs.openbsd.org 2013/07/20 22:20:42
diff --git a/channels.c b/channels.c
index 9e87bfb9..281df380 100644
--- a/channels.c
+++ b/channels.c
@@ -248,7 +248,10 @@ channel_register_fds(Channel *c, int rfd, int wfd, int efd,
if ((c->isatty = is_tty) != 0)
debug2("channel %d: rfd %d isatty", c->self, c->rfd);
+#ifdef _AIX
+ /* XXX: Later AIX versions can't push as much data to tty */
c->wfd_isatty = is_tty || isatty(c->wfd);
+#endif
/* enable nonblocking mode */
if (nonblock) {
diff --git a/channels.h b/channels.h
index ffd58072..4fab9d7c 100644
--- a/channels.h
+++ b/channels.h
@@ -103,7 +103,9 @@ struct Channel {
int sock; /* sock fd */
int ctl_chan; /* control channel (multiplexed connections) */
int isatty; /* rfd is a tty */
+#ifdef _AIX
int wfd_isatty; /* wfd is a tty */
+#endif
int client_tty; /* (client) TTY has been requested */
int force_drain; /* force close on iEOF */
time_t notbefore; /* Pause IO until deadline (time_t) */