- for (node = waiters.next; node != &waiters; ) {
- pw = CONTAINER_OF(node, struct poll_waiter, node);
- if (!pw->pollfd || !pw->pollfd->revents) {
- if (pw->function) {
- node = node->next;
- continue;
- }
- } else {
- if (VLOG_IS_DBG_ENABLED()) {
- log_wakeup(pw->backtrace, "%s%s%s%s%s on fd %d",
- pw->pollfd->revents & POLLIN ? "[POLLIN]" : "",
- pw->pollfd->revents & POLLOUT ? "[POLLOUT]" : "",
- pw->pollfd->revents & POLLERR ? "[POLLERR]" : "",
- pw->pollfd->revents & POLLHUP ? "[POLLHUP]" : "",
- pw->pollfd->revents & POLLNVAL ? "[POLLNVAL]" : "",
- pw->fd);
- }
-
- if (pw->function) {
-#ifndef NDEBUG
- running_cb = pw;
-#endif
- pw->function(pw->fd, pw->pollfd->revents, pw->aux);
-#ifndef NDEBUG
- running_cb = NULL;
-#endif
- }
+ LIST_FOR_EACH_SAFE (pw, next, node, &waiters) {
+ if (pw->pollfd->revents) {
+ log_wakeup(pw->where, pw->pollfd, 0);