From 0958ed32a54cb2147c108113c9e42e4f56e6cdbb Mon Sep 17 00:00:00 2001 From: yang-g Date: Mon, 6 May 2019 16:30:15 -0700 Subject: [PATCH] Resolve review comments --- src/core/lib/iomgr/ev_epoll1_linux.cc | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/core/lib/iomgr/ev_epoll1_linux.cc b/src/core/lib/iomgr/ev_epoll1_linux.cc index 4dff4579dac..35e4e119649 100644 --- a/src/core/lib/iomgr/ev_epoll1_linux.cc +++ b/src/core/lib/iomgr/ev_epoll1_linux.cc @@ -384,7 +384,11 @@ static void fd_shutdown_internal(grpc_fd* fd, grpc_error* why, if (!releasing_fd) { shutdown(fd->fd, SHUT_RDWR); } else { - if (epoll_ctl(g_epoll_set.epfd, EPOLL_CTL_DEL, fd->fd, nullptr) != 0) { + /* we need a dummy event for earlier linux versions. */ + epoll_event dummy_event; + memset(&dummy_event, 0, sizeof(dummy_event)); + if (epoll_ctl(g_epoll_set.epfd, EPOLL_CTL_DEL, fd->fd, &dummy_event) != + 0) { gpr_log(GPR_ERROR, "epoll_ctl failed: %s", strerror(errno)); } }