Index: channels.c =================================================================== RCS file: /usr/local/src/security/openssh/cvs/openssh/channels.c,v retrieving revision 1.251 diff -u -p -r1.251 channels.c --- channels.c 28 Jan 2007 23:16:28 -0000 1.251 +++ channels.c 10 Apr 2007 08:58:39 -0000 @@ -1449,11 +1449,10 @@ channel_handle_rfd(Channel *c, fd_set *r int len; if (c->rfd != -1 && - (c->detach_close || FD_ISSET(c->rfd, readset))) { + 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)) return 1; #ifndef PTY_ZEROREAD if (len <= 0) { @@ -1605,12 +1604,11 @@ channel_handle_efd(Channel *c, fd_set *r c->local_consumed += len; } } else if (c->extended_usage == CHAN_EXTENDED_READ && - (c->detach_close || FD_ISSET(c->efd, readset))) { + FD_ISSET(c->efd, readset)) { len = read(c->efd, buf, sizeof(buf)); debug2("channel %d: read %d from efd %d", c->self, len, c->efd); - if (len < 0 && (errno == EINTR || - (errno == EAGAIN && !c->detach_close))) + if (len < 0 && (errno == EINTR || errno == EAGAIN)) return 1; if (len <= 0) { debug2("channel %d: closing read-efd %d", Index: serverloop.c =================================================================== RCS file: /usr/local/src/security/openssh/cvs/openssh/serverloop.c,v retrieving revision 1.151 diff -u -p -r1.151 serverloop.c --- serverloop.c 28 Jan 2007 23:16:28 -0000 1.151 +++ serverloop.c 10 Apr 2007 08:58:39 -0000 @@ -280,7 +280,6 @@ wait_until_can_do_something(fd_set **rea struct timeval tv, *tvp; int ret; int client_alive_scheduled = 0; - int program_alive_scheduled = 0; /* * if using client_alive, set the max timeout accordingly, @@ -318,7 +317,6 @@ wait_until_can_do_something(fd_set **rea * the client, try to get some more data from the program. */ if (packet_not_very_much_data_to_write()) { - program_alive_scheduled = child_terminated; if (!fdout_eof) FD_SET(fdout, *readsetp); if (!fderr_eof) @@ -364,16 +362,8 @@ wait_until_can_do_something(fd_set **rea memset(*writesetp, 0, *nallocp); if (errno != EINTR) error("select: %.100s", strerror(errno)); - } else { - if (ret == 0 && client_alive_scheduled) - client_alive_check(); - if (!compat20 && program_alive_scheduled && fdin_is_tty) { - if (!fdout_eof) - FD_SET(fdout, *readsetp); - if (!fderr_eof) - FD_SET(fderr, *readsetp); - } - } + } else if (ret == 0 && client_alive_scheduled) + client_alive_check(); notify_done(*readsetp); } @@ -417,8 +407,7 @@ process_input(fd_set *readset) if (!fdout_eof && FD_ISSET(fdout, readset)) { errno = 0; len = read(fdout, buf, sizeof(buf)); - if (len < 0 && (errno == EINTR || - (errno == EAGAIN && !child_terminated))) { + if (len < 0 && (errno == EINTR || errno == EAGAIN)) { /* do nothing */ #ifndef PTY_ZEROREAD } else if (len <= 0) { @@ -436,8 +425,7 @@ process_input(fd_set *readset) if (!fderr_eof && FD_ISSET(fderr, readset)) { errno = 0; len = read(fderr, buf, sizeof(buf)); - if (len < 0 && (errno == EINTR || - (errno == EAGAIN && !child_terminated))) { + if (len < 0 && (errno == EINTR || errno == EAGAIN)) { /* do nothing */ #ifndef PTY_ZEROREAD } else if (len <= 0) {