View | Details | Raw Unified | Return to bug 2071
Collapse All | Expand All

(-)a/channels.c (-3 / +5 lines)
Lines 2100-2115 channel_handle_efd_read(struct ssh *ssh, Channel *c, Link Here
2100
    fd_set *readset, fd_set *writeset)
2100
    fd_set *readset, fd_set *writeset)
2101
{
2101
{
2102
	char buf[CHAN_RBUF];
2102
	char buf[CHAN_RBUF];
2103
	int r;
2104
	ssize_t len;
2103
	ssize_t len;
2104
	int r, force;
2105
2105
2106
	if (!c->detach_close && !FD_ISSET(c->efd, readset))
2106
	force = c->isatty && c->detach_close && c->istate != CHAN_INPUT_CLOSED;
2107
2108
	if (c->efd == -1 || (!force && !FD_ISSET(c->efd, readset)))
2107
		return 1;
2109
		return 1;
2108
2110
2109
	len = read(c->efd, buf, sizeof(buf));
2111
	len = read(c->efd, buf, sizeof(buf));
2110
	debug2("channel %d: read %zd from efd %d", c->self, len, c->efd);
2112
	debug2("channel %d: read %zd from efd %d", c->self, len, c->efd);
2111
	if (len < 0 && (errno == EINTR || ((errno == EAGAIN ||
2113
	if (len < 0 && (errno == EINTR || ((errno == EAGAIN ||
2112
	    errno == EWOULDBLOCK) && !c->detach_close)))
2114
	    errno == EWOULDBLOCK) && !force)))
2113
		return 1;
2115
		return 1;
2114
	if (len <= 0) {
2116
	if (len <= 0) {
2115
		debug2("channel %d: closing read-efd %d",
2117
		debug2("channel %d: closing read-efd %d",

Return to bug 2071