- /* Cache it for debugging; current changes. */
- struct io_conn *conn = current;
- int saved_errno = errno;
-
- if (!doing_debug_on(conn))
- return ret;
-
- /* These will all go linearly through the io_debug() path above. */
- switch (ret) {
- case -1:
- /* This will call io_debug above. */
- errno = saved_errno;
- io_close();
- break;
- case 0: /* Keep going with plan. */
- io_debug(conn->plan);
- break;
- case 1: /* Done: get next plan. */
- if (timeout_active(conn))
- backend_del_timeout(conn);
- /* In case they call io_duplex, clear our poll flags so
- * both sides don't seem to be both doing read or write
- * (See assert(!mask || pfd->events != mask) in poll.c) */
- conn->plan.pollflag = 0;
- conn->plan.next(conn, conn->plan.next_arg);
- break;
- default:
- abort();
- }
-
- /* Normally-invalid value, used for sanity check. */
- return 2;