aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorGravatar Craig Tiller <ctiller@google.com>2015-06-30 09:47:25 -0700
committerGravatar Craig Tiller <ctiller@google.com>2015-06-30 09:47:25 -0700
commitd1d0c0a876fa22cf47700173aa6c68278e2ff662 (patch)
tree9c55d09d4d62ae47fc83bafc47e70a8aa09436bc
parent614e27a10acb4d95a716da86c0a3c673d3b52957 (diff)
Fix a bug where we can spuriously wakeup a nonexistant fd
-rw-r--r--src/core/iomgr/pollset_multipoller_with_poll_posix.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/core/iomgr/pollset_multipoller_with_poll_posix.c b/src/core/iomgr/pollset_multipoller_with_poll_posix.c
index cc062693a9..7b717bd159 100644
--- a/src/core/iomgr/pollset_multipoller_with_poll_posix.c
+++ b/src/core/iomgr/pollset_multipoller_with_poll_posix.c
@@ -179,6 +179,9 @@ static void multipoll_with_poll_pollset_maybe_work(
grpc_pollset_kick_consume(&pollset->kick_state, kfd);
}
for (i = 1; i < np; i++) {
+ if (h->watchers[i].fd == NULL) {
+ continue;
+ }
if (h->pfds[i].revents & (POLLIN | POLLHUP | POLLERR)) {
grpc_fd_become_readable(h->watchers[i].fd, allow_synchronous_callback);
}