summaryrefslogtreecommitdiffstats
path: root/channels.c
diff options
context:
space:
mode:
authorDamien Miller <djm@mindrot.org>2008-05-19 16:05:41 +1000
committerDamien Miller <djm@mindrot.org>2008-05-19 16:05:41 +1000
commitd654dd27b5774575edd341827c38735ac9222174 (patch)
tree9a26f5f81100f4e092dcdabff65d46397b692bd1 /channels.c
parent2ff1ca56ebee93d2881e4abaab1b8bc84dad4db8 (diff)
- markus@cvs.openbsd.org 2008/05/09 16:17:51
[channels.c] error-fd race: don't enable the error fd in the select bitmask for channels with both in- and output closed, since the channel will go away before we call select(); report, lots of debugging help and ok djm@
Diffstat (limited to 'channels.c')
-rw-r--r--channels.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/channels.c b/channels.c
index 1e57951d..99b23d75 100644
--- a/channels.c
+++ b/channels.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: channels.c,v 1.276 2008/05/09 04:55:56 djm Exp $ */
+/* $OpenBSD: channels.c,v 1.277 2008/05/09 16:17:51 markus Exp $ */
/*
* Author: Tatu Ylonen <ylo@cs.hut.fi>
* Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
@@ -819,7 +819,8 @@ channel_pre_open(Channel *c, fd_set *readset, fd_set *writeset)
}
}
/** XXX check close conditions, too */
- if (compat20 && c->efd != -1) {
+ if (compat20 && c->efd != -1 &&
+ !(c->istate == CHAN_INPUT_CLOSED && c->ostate == CHAN_OUTPUT_CLOSED)) {
if (c->extended_usage == CHAN_EXTENDED_WRITE &&
buffer_len(&c->extended) > 0)
FD_SET(c->efd, writeset);