Skip to content
This repository has been archived by the owner on May 6, 2022. It is now read-only.

Commit

Permalink
- (djm) [channels.c channels.h] bz#2135: On Solaris, isatty() on a non-
Browse files Browse the repository at this point in the history
   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.
  • Loading branch information
djmdjm committed Aug 1, 2013
1 parent 81f7cf1 commit c192a4c
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 0 deletions.
7 changes: 7 additions & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
@@ -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
Expand Down
3 changes: 3 additions & 0 deletions channels.c
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
2 changes: 2 additions & 0 deletions channels.h
Original file line number Diff line number Diff line change
Expand Up @@ -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) */
Expand Down

0 comments on commit c192a4c

Please sign in to comment.