summaryrefslogtreecommitdiff
path: root/channels.c
diff options
context:
space:
mode:
authorDamien Miller <djm@mindrot.org>2007-06-11 13:03:16 +1000
committerDamien Miller <djm@mindrot.org>2007-06-11 13:03:16 +1000
commit835284b74c984600aa50ebac527c37238027b4da (patch)
treeb10f9bca25aba416b31d332c55ef1c64608d8b76 /channels.c
parent66177929aef3f13e0c2c8ce4430af1252ad7b66b (diff)
- (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.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/channels.c b/channels.c
index c68ad6419..bb14450f4 100644
--- a/channels.c
+++ b/channels.c
@@ -1446,14 +1446,13 @@ static int
1446channel_handle_rfd(Channel *c, fd_set *readset, fd_set *writeset) 1446channel_handle_rfd(Channel *c, fd_set *readset, fd_set *writeset)
1447{ 1447{
1448 char buf[CHAN_RBUF]; 1448 char buf[CHAN_RBUF];
1449 int len; 1449 int len, force;
1450 1450
1451 if (c->rfd != -1 && 1451 force = c->isatty && c->detach_close && c->istate != CHAN_INPUT_CLOSED;
1452 (c->detach_close || FD_ISSET(c->rfd, readset))) { 1452 if (c->rfd != -1 && (force || FD_ISSET(c->rfd, readset))) {
1453 errno = 0; 1453 errno = 0;
1454 len = read(c->rfd, buf, sizeof(buf)); 1454 len = read(c->rfd, buf, sizeof(buf));
1455 if (len < 0 && (errno == EINTR || 1455 if (len < 0 && (errno == EINTR || (errno == EAGAIN && !force)))
1456 (errno == EAGAIN && !(c->isatty && c->detach_close))))
1457 return 1; 1456 return 1;
1458#ifndef PTY_ZEROREAD 1457#ifndef PTY_ZEROREAD
1459 if (len <= 0) { 1458 if (len <= 0) {