io: allow freeing of io_conn at any time.
authorRusty Russell <rusty@rustcorp.com.au>
Thu, 29 Dec 2016 04:31:32 +0000 (15:01 +1030)
committerRusty Russell <rusty@rustcorp.com.au>
Thu, 29 Dec 2016 23:12:44 +0000 (09:42 +1030)
commit31c816a6a9a2037d8860d56814835d9ac488d52f
tree71daa02a83248b56741e37628cf7eb395cae735e
parent96dcdfbf1a400f7cb43cf3f0761f52fd6de9ff65
io: allow freeing of io_conn at any time.

io_close() currently marks the io_conn for freeing, but doesn't
actually do it.  This is a problem for tal() users, because we can't
just call it in the parent's constructor.

Make io_close() just tal_free() + return &io_conn_freed (a magic
io_plan pointer).

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
ccan/io/backend.h
ccan/io/io.c
ccan/io/poll.c
ccan/io/test/run-18-errno.c