X-Git-Url: https://git.ozlabs.org/?a=blobdiff_plain;ds=sidebyside;f=ccan%2Fio%2Fpoll.c;h=b44f12563865f6729155371ff8e4ca17a778e160;hb=0fa318d0eeccbb4d33310f048653fa212c12d86d;hp=a853c8705f1d5b68971327ec9c38d22ef4222e2b;hpb=a5881c0deb210f56c2095366ae6cdabd5230d68d;p=ccan diff --git a/ccan/io/poll.c b/ccan/io/poll.c index a853c870..b44f1256 100644 --- a/ccan/io/poll.c +++ b/ccan/io/poll.c @@ -58,7 +58,7 @@ static bool add_fd(struct fd *fd, short events) pollfds[num_fds].events = events; /* In case it's idle. */ if (!events) - pollfds[num_fds].fd = -fd->fd; + pollfds[num_fds].fd = -fd->fd - 1; else pollfds[num_fds].fd = fd->fd; pollfds[num_fds].revents = 0; /* In case we're iterating now */ @@ -176,7 +176,7 @@ void backend_new_plan(struct io_conn *conn) num_waiting++; pfd->fd = conn->fd.fd; } else { - pfd->fd = -conn->fd.fd; + pfd->fd = -conn->fd.fd - 1; } }