]> git.ozlabs.org Git - ccan/blobdiff - ccan/io/poll.c
io: query whether io_plan in/out have started.
[ccan] / ccan / io / poll.c
index a4e83ed761e77251767b01b3e3f5c5dd3492bfcd..3354abe01a2bae38ae6728b9f9f07522053b90b2 100644 (file)
@@ -130,9 +130,11 @@ void backend_new_plan(struct io_conn *conn)
                num_waiting--;
 
        pfd->events = 0;
-       if (conn->plan[IO_IN].status == IO_POLLING)
+       if (conn->plan[IO_IN].status == IO_POLLING_NOTSTARTED
+           || conn->plan[IO_IN].status == IO_POLLING_STARTED)
                pfd->events |= POLLIN;
-       if (conn->plan[IO_OUT].status == IO_POLLING)
+       if (conn->plan[IO_OUT].status == IO_POLLING_NOTSTARTED
+           || conn->plan[IO_OUT].status == IO_POLLING_STARTED)
                pfd->events |= POLLOUT;
 
        if (pfd->events) {