From 0dac03febdb52ccf0dfe19dcb1d7e895264b218a Mon Sep 17 00:00:00 2001 From: Damien Miller Date: Sat, 30 Jan 2010 17:36:33 +1100 Subject: - djm@cvs.openbsd.org 2010/01/29 20:16:17 [mux.c] kill correct channel (was killing already-dead mux channel, not its session channel) --- mux.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'mux.c') diff --git a/mux.c b/mux.c index 0e07883e4..825fb7a9a 100644 --- a/mux.c +++ b/mux.c @@ -1,4 +1,4 @@ -/* $OpenBSD: mux.c,v 1.13 2010/01/29 20:16:17 djm Exp $ */ +/* $OpenBSD: mux.c,v 1.14 2010/01/30 02:54:53 djm Exp $ */ /* * Copyright (c) 2002-2008 Damien Miller * @@ -214,8 +214,10 @@ mux_master_control_cleanup_cb(int cid, void *unused) debug2("%s: channel %d: not open", __func__, sc->self); chan_mark_dead(sc); } else { - chan_read_failed(sc); - chan_write_failed(sc); + if (sc->istate == CHAN_INPUT_OPEN) + chan_read_failed(sc); + if (sc->ostate == CHAN_OUTPUT_OPEN) + chan_write_failed(sc); } } channel_cancel_cleanup(c->self); -- cgit v1.2.3