]> git.ozlabs.org Git - ccan/blobdiff - ccan/io/io.c
io: make io_close_taken_fd() unset nonblocking on the fd.
[ccan] / ccan / io / io.c
index 4c41c93a683214fd24b50a647a94b31706d98017..68b95e82467194f13e87302e907cda5020fe37db 100644 (file)
@@ -421,6 +421,14 @@ struct io_plan *io_close_cb(struct io_conn *conn, void *next_arg)
        return io_close(conn);
 }
 
+struct io_plan *io_close_taken_fd(struct io_conn *conn)
+{
+       set_blocking(conn->fd.fd, true);
+
+       cleanup_conn_without_close(conn);
+       return io_close(conn);
+}
+
 /* Exit the loop, returning this (non-NULL) arg. */
 void io_break(const void *ret)
 {