=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/ssh/channels.c,v retrieving revision 1.44 retrieving revision 1.45 diff -u -r1.44 -r1.45 --- src/usr.bin/ssh/channels.c 2000/04/03 07:07:15 1.44 +++ src/usr.bin/ssh/channels.c 2000/04/04 06:18:01 1.45 @@ -17,7 +17,7 @@ */ #include "includes.h" -RCSID("$Id: channels.c,v 1.44 2000/04/03 07:07:15 markus Exp $"); +RCSID("$Id: channels.c,v 1.45 2000/04/04 06:18:01 markus Exp $"); #include "ssh.h" #include "packet.h" @@ -642,6 +642,7 @@ char buf[16*1024]; int len; +/** XXX handle drain efd, too */ if (c->efd != -1) { if (c->extended_usage == CHAN_EXTENDED_WRITE && FD_ISSET(c->efd, writeset) && @@ -659,7 +660,12 @@ len = read(c->efd, buf, sizeof(buf)); debug("channel %d: read %d from efd %d", c->self, len, c->efd); - if (len > 0) + if (len == 0) { + debug("channel %d: closing efd %d", + c->self, c->efd); + close(c->efd); + c->efd = -1; + } else if (len > 0) buffer_append(&c->extended, buf, len); } }