From d2738eb9f31d20d0abfdbb1dd41e6af5e521a5d9 Mon Sep 17 00:00:00 2001 From: Colin Watson Date: Mon, 18 Jun 2007 19:46:10 +0000 Subject: * Backport from upstream: - Silence spurious error messages from hang-on-exit fix (http://bugzilla.mindrot.org/show_bug.cgi?id=1306, closes: #429531). --- channels.c | 9 ++++----- debian/changelog | 3 +++ 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/channels.c b/channels.c index 530c0d460..6b0fb0b71 100644 --- a/channels.c +++ b/channels.c @@ -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) { diff --git a/debian/changelog b/debian/changelog index 95a7c741b..7ffc040da 100644 --- a/debian/changelog +++ b/debian/changelog @@ -12,6 +12,9 @@ openssh (1:4.6p1-2) UNRELEASED; urgency=low * Add try-restart action to init script. * Add /etc/network/if-up.d/openssh-server to restart sshd when new interfaces appear (LP: #103436). + * Backport from upstream: + - Silence spurious error messages from hang-on-exit fix + (http://bugzilla.mindrot.org/show_bug.cgi?id=1306, closes: #429531). -- Colin Watson Wed, 13 Jun 2007 00:56:45 +0100 -- cgit v1.2.3