diff options
author | Damien Miller <djm@mindrot.org> | 2007-06-11 13:03:16 +1000 |
---|---|---|
committer | Damien Miller <djm@mindrot.org> | 2007-06-11 13:03:16 +1000 |
commit | 835284b74c984600aa50ebac527c37238027b4da (patch) | |
tree | b10f9bca25aba416b31d332c55ef1c64608d8b76 /channels.c | |
parent | 66177929aef3f13e0c2c8ce4430af1252ad7b66b (diff) | |
download | openssh-git-835284b74c984600aa50ebac527c37238027b4da.tar.gz |
- (djm) Bugzilla #1306: silence spurious error messages from hang-on-exit
fix; tested by dtucker@ and jochen.kirn AT gmail.com
Diffstat (limited to 'channels.c')
-rw-r--r-- | channels.c | 9 |
1 files changed, 4 insertions, 5 deletions
@@ -1446,14 +1446,13 @@ static int channel_handle_rfd(Channel *c, fd_set *readset, fd_set *writeset) { char buf[CHAN_RBUF]; - int len; + int len, force; - if (c->rfd != -1 && - (c->detach_close || FD_ISSET(c->rfd, readset))) { + force = c->isatty && c->detach_close && c->istate != CHAN_INPUT_CLOSED; + if (c->rfd != -1 && (force || FD_ISSET(c->rfd, readset))) { errno = 0; len = read(c->rfd, buf, sizeof(buf)); - if (len < 0 && (errno == EINTR || - (errno == EAGAIN && !(c->isatty && c->detach_close)))) + if (len < 0 && (errno == EINTR || (errno == EAGAIN && !force))) return 1; #ifndef PTY_ZEROREAD if (len <= 0) { |