|
Lines 1374-1383
channel_handle_rfd(Channel *c, fd_set *
Link Here
|
| 1374 |
|
1374 |
|
| 1375 |
if (c->rfd != -1 && |
1375 |
if (c->rfd != -1 && |
| 1376 |
FD_ISSET(c->rfd, readset)) { |
1376 |
FD_ISSET(c->rfd, readset)) { |
|
|
1377 |
errno = 0; |
| 1377 |
len = read(c->rfd, buf, sizeof(buf)); |
1378 |
len = read(c->rfd, buf, sizeof(buf)); |
| 1378 |
if (len < 0 && (errno == EINTR || errno == EAGAIN)) |
1379 |
if (len < 0 && (errno == EINTR || errno == EAGAIN)) |
| 1379 |
return 1; |
1380 |
return 1; |
| 1380 |
if (len <= 0) { |
1381 |
if (len < 0 || (len == 0 && errno != 0)) { |
| 1381 |
debug2("channel %d: read<=0 rfd %d len %d", |
1382 |
debug2("channel %d: read<=0 rfd %d len %d", |
| 1382 |
c->self, c->rfd, len); |
1383 |
c->self, c->rfd, len); |
| 1383 |
if (c->type != SSH_CHANNEL_OPEN) { |
1384 |
if (c->type != SSH_CHANNEL_OPEN) { |
|
Lines 1511-1520
channel_handle_ctl(Channel *c, fd_set *
Link Here
|
| 1511 |
|
1512 |
|
| 1512 |
/* Monitor control fd to detect if the slave client exits */ |
1513 |
/* Monitor control fd to detect if the slave client exits */ |
| 1513 |
if (c->ctl_fd != -1 && FD_ISSET(c->ctl_fd, readset)) { |
1514 |
if (c->ctl_fd != -1 && FD_ISSET(c->ctl_fd, readset)) { |
|
|
1515 |
errno = 0; |
| 1514 |
len = read(c->ctl_fd, buf, sizeof(buf)); |
1516 |
len = read(c->ctl_fd, buf, sizeof(buf)); |
| 1515 |
if (len < 0 && (errno == EINTR || errno == EAGAIN)) |
1517 |
if (len < 0 && (errno == EINTR || errno == EAGAIN)) |
| 1516 |
return 1; |
1518 |
return 1; |
| 1517 |
if (len <= 0) { |
1519 |
if (len < 0 || (len == 0 && errno != 0)) { |
| 1518 |
debug2("channel %d: ctl read<=0", c->self); |
1520 |
debug2("channel %d: ctl read<=0", c->self); |
| 1519 |
if (c->type != SSH_CHANNEL_OPEN) { |
1521 |
if (c->type != SSH_CHANNEL_OPEN) { |
| 1520 |
debug2("channel %d: not open", c->self); |
1522 |
debug2("channel %d: not open", c->self); |