diff options
author | Craig Tiller <ctiller@google.com> | 2015-06-02 08:02:14 -0700 |
---|---|---|
committer | Craig Tiller <ctiller@google.com> | 2015-06-02 08:02:14 -0700 |
commit | 3a862e3b1047a081061d5ea207a7db3ec47a2e6d (patch) | |
tree | 6c027ea1b4b425a69ade81c7b0a074b1cd4fc3f0 | |
parent | 0317b3d082a2120900123744aeaadd871133e724 (diff) |
Fix MSAN reported error
-rw-r--r-- | src/core/iomgr/pollset_posix.c | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/src/core/iomgr/pollset_posix.c b/src/core/iomgr/pollset_posix.c index 0a18d18671..1055006740 100644 --- a/src/core/iomgr/pollset_posix.c +++ b/src/core/iomgr/pollset_posix.c @@ -389,11 +389,13 @@ static int basic_pollset_maybe_work(grpc_pollset *pollset, if (pfd[0].revents & POLLIN) { grpc_pollset_kick_consume(&pollset->kick_state, kfd); } - if (pfd[1].revents & (POLLIN | POLLHUP | POLLERR)) { - grpc_fd_become_readable(fd, allow_synchronous_callback); - } - if (pfd[1].revents & (POLLOUT | POLLHUP | POLLERR)) { - grpc_fd_become_writable(fd, allow_synchronous_callback); + if (nfds > 1) { + if (pfd[1].revents & (POLLIN | POLLHUP | POLLERR)) { + grpc_fd_become_readable(fd, allow_synchronous_callback); + } + if (pfd[1].revents & (POLLOUT | POLLHUP | POLLERR)) { + grpc_fd_become_writable(fd, allow_synchronous_callback); + } } } |