diff options
author | Rusty Russell <rusty@rustcorp.com.au> | 2014-04-13 21:25:37 +0930 |
---|---|---|
committer | Rusty Russell <rusty@rustcorp.com.au> | 2014-04-24 16:14:26 +0930 |
commit | ab6e77749bfe678bde2cdf1442145bfbcaea253d (patch) | |
tree | e90225a6bba75bae5753fda6cbf3dbc4ca7aa669 | |
parent | f7ab2c65d40839a327e50876dc2708ab7b11aa52 (diff) |
io: don't close if already closing in io_close_other.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
-rw-r--r-- | ccan/io/io.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/ccan/io/io.c b/ccan/io/io.c index a1610a40..4c73b624 100644 --- a/ccan/io/io.c +++ b/ccan/io/io.c @@ -490,8 +490,11 @@ struct io_plan io_close_cb(struct io_conn *conn, void *arg) void io_close_other(struct io_conn *conn) { - conn->plan = io_close_(); - backend_plan_changed(conn); + /* Don't close if already closing! */ + if (conn->plan.next) { + conn->plan = io_close_(); + backend_plan_changed(conn); + } } /* Exit the loop, returning this (non-NULL) arg. */ |