|
Lines 1497-1503
Link Here
|
| 1497 |
if (c->rfd != -1 && (force || FD_ISSET(c->rfd, readset))) { |
1497 |
if (c->rfd != -1 && (force || FD_ISSET(c->rfd, readset))) { |
| 1498 |
errno = 0; |
1498 |
errno = 0; |
| 1499 |
len = read(c->rfd, buf, sizeof(buf)); |
1499 |
len = read(c->rfd, buf, sizeof(buf)); |
| 1500 |
if (len < 0 && (errno == EINTR || (errno == EAGAIN && !force))) |
1500 |
if (len < 0 && (errno == EINTR || |
|
|
1501 |
((errno == EAGAIN || errno == EWOULDBLOCK) && !force))) |
| 1501 |
return 1; |
1502 |
return 1; |
| 1502 |
#ifndef PTY_ZEROREAD |
1503 |
#ifndef PTY_ZEROREAD |
| 1503 |
if (len <= 0) { |
1504 |
if (len <= 0) { |
|
Lines 1568-1574
Link Here
|
| 1568 |
c->local_consumed += dlen + 4; |
1569 |
c->local_consumed += dlen + 4; |
| 1569 |
len = write(c->wfd, buf, dlen); |
1570 |
len = write(c->wfd, buf, dlen); |
| 1570 |
xfree(data); |
1571 |
xfree(data); |
| 1571 |
if (len < 0 && (errno == EINTR || errno == EAGAIN)) |
1572 |
if (len < 0 && (errno == EINTR || errno == EAGAIN || |
|
|
1573 |
errno == EWOULDBLOCK)) |
| 1572 |
return 1; |
1574 |
return 1; |
| 1573 |
if (len <= 0) { |
1575 |
if (len <= 0) { |
| 1574 |
if (c->type != SSH_CHANNEL_OPEN) |
1576 |
if (c->type != SSH_CHANNEL_OPEN) |
|
Lines 1586-1592
Link Here
|
| 1586 |
#endif |
1588 |
#endif |
| 1587 |
|
1589 |
|
| 1588 |
len = write(c->wfd, buf, dlen); |
1590 |
len = write(c->wfd, buf, dlen); |
| 1589 |
if (len < 0 && (errno == EINTR || errno == EAGAIN)) |
1591 |
if (len < 0 && |
|
|
1592 |
(errno == EINTR || errno == EAGAIN || errno == EWOULDBLOCK)) |
| 1590 |
return 1; |
1593 |
return 1; |
| 1591 |
if (len <= 0) { |
1594 |
if (len <= 0) { |
| 1592 |
if (c->type != SSH_CHANNEL_OPEN) { |
1595 |
if (c->type != SSH_CHANNEL_OPEN) { |
|
Lines 1638-1644
Link Here
|
| 1638 |
buffer_len(&c->extended)); |
1641 |
buffer_len(&c->extended)); |
| 1639 |
debug2("channel %d: written %d to efd %d", |
1642 |
debug2("channel %d: written %d to efd %d", |
| 1640 |
c->self, len, c->efd); |
1643 |
c->self, len, c->efd); |
| 1641 |
if (len < 0 && (errno == EINTR || errno == EAGAIN)) |
1644 |
if (len < 0 && (errno == EINTR || errno == EAGAIN || |
|
|
1645 |
errno == EWOULDBLOCK)) |
| 1642 |
return 1; |
1646 |
return 1; |
| 1643 |
if (len <= 0) { |
1647 |
if (len <= 0) { |
| 1644 |
debug2("channel %d: closing write-efd %d", |
1648 |
debug2("channel %d: closing write-efd %d", |
|
Lines 1653-1660
Link Here
|
| 1653 |
len = read(c->efd, buf, sizeof(buf)); |
1657 |
len = read(c->efd, buf, sizeof(buf)); |
| 1654 |
debug2("channel %d: read %d from efd %d", |
1658 |
debug2("channel %d: read %d from efd %d", |
| 1655 |
c->self, len, c->efd); |
1659 |
c->self, len, c->efd); |
| 1656 |
if (len < 0 && (errno == EINTR || |
1660 |
if (len < 0 && (errno == EINTR || ((errno == EAGAIN || |
| 1657 |
(errno == EAGAIN && !c->detach_close))) |
1661 |
errno == EWOULDBLOCK) && !c->detach_close))) |
| 1658 |
return 1; |
1662 |
return 1; |
| 1659 |
if (len <= 0) { |
1663 |
if (len <= 0) { |
| 1660 |
debug2("channel %d: closing read-efd %d", |
1664 |
debug2("channel %d: closing read-efd %d", |
|
Lines 1678-1684
Link Here
|
| 1678 |
/* Monitor control fd to detect if the slave client exits */ |
1682 |
/* Monitor control fd to detect if the slave client exits */ |
| 1679 |
if (c->ctl_fd != -1 && FD_ISSET(c->ctl_fd, readset)) { |
1683 |
if (c->ctl_fd != -1 && FD_ISSET(c->ctl_fd, readset)) { |
| 1680 |
len = read(c->ctl_fd, buf, sizeof(buf)); |
1684 |
len = read(c->ctl_fd, buf, sizeof(buf)); |
| 1681 |
if (len < 0 && (errno == EINTR || errno == EAGAIN)) |
1685 |
if (len < 0 && |
|
|
1686 |
(errno == EINTR || errno == EAGAIN || errno == EWOULDBLOCK)) |
| 1682 |
return 1; |
1687 |
return 1; |
| 1683 |
if (len <= 0) { |
1688 |
if (len <= 0) { |
| 1684 |
debug2("channel %d: ctl read<=0", c->self); |
1689 |
debug2("channel %d: ctl read<=0", c->self); |