summaryrefslogtreecommitdiff
path: root/nchan.c
diff options
context:
space:
mode:
authormouring <mouring>2001-06-05 20:52:50 +0000
committermouring <mouring>2001-06-05 20:52:50 +0000
commit57dccc2d66925b5e02d9c863558cdbdf20ad39c9 (patch)
treea972c40cff874dcf22b22a346895457a734157ef /nchan.c
parent8056e4497746e17fdf4ee6502a11768dd44eaebc (diff)
downloadopenssh-57dccc2d66925b5e02d9c863558cdbdf20ad39c9.tar.gz
- markus@cvs.openbsd.org 2001/05/28 23:14:49
[channels.c channels.h nchan.c] undo broken channel fix and try a different one. there should be still some select errors...
Diffstat (limited to 'nchan.c')
-rw-r--r--nchan.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/nchan.c b/nchan.c
index 38d860ba..957c4561 100644
--- a/nchan.c
+++ b/nchan.c
@@ -23,7 +23,7 @@
*/
#include "includes.h"
-RCSID("$OpenBSD: nchan.c,v 1.25 2001/05/16 22:09:21 markus Exp $");
+RCSID("$OpenBSD: nchan.c,v 1.26 2001/05/28 23:14:49 markus Exp $");
#include "ssh1.h"
#include "ssh2.h"
@@ -394,14 +394,16 @@ chan_send_close2(Channel *c)
void
chan_mark_dead(Channel *c)
{
- c->flags |= CHAN_DEAD;
+ c->type = SSH_CHANNEL_ZOMBIE;
}
int
chan_is_dead(Channel *c)
{
- if (c->flags & CHAN_DEAD)
+ if (c->type == SSH_CHANNEL_ZOMBIE) {
+ debug("channel %d: zombie", c->self);
return 1;
+ }
if (c->istate != CHAN_INPUT_CLOSED || c->ostate != CHAN_OUTPUT_CLOSED)
return 0;
if (!compat20) {
@@ -484,6 +486,7 @@ chan_shutdown_write(Channel *c)
if (close(c->wfd) < 0)
log("channel %d: chan_shutdown_write: close() failed for fd%d: %.100s",
c->self, c->wfd, strerror(errno));
+ c->wfd = -1;
}
}
static void
@@ -506,5 +509,6 @@ chan_shutdown_read(Channel *c)
if (close(c->rfd) < 0)
log("channel %d: chan_shutdown_read: close() failed for fd%d: %.100s",
c->self, c->rfd, strerror(errno));
+ c->rfd = -1;
}
}