From 612fc4743d2ebc2cff9d904877e3607edbf571e2 Mon Sep 17 00:00:00 2001 From: Amos Jeffries Date: Tue, 21 Apr 2015 07:20:23 -0700 Subject: [PATCH] Epoll: initialize kdpfd and epoll_event in all cases --- src/comm/ModEpoll.cc | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/src/comm/ModEpoll.cc b/src/comm/ModEpoll.cc index d3c731a9c6..12fb202292 100644 --- a/src/comm/ModEpoll.cc +++ b/src/comm/ModEpoll.cc @@ -49,7 +49,7 @@ #include #endif -static int kdpfd; +static int kdpfd = -1; static int max_poll_time = 1000; static struct epoll_event *pevents; @@ -109,17 +109,13 @@ Comm::SetSelect(int fd, unsigned int type, PF * handler, void *client_data, time fde *F = &fd_table[fd]; int epoll_ctl_type = 0; - struct epoll_event ev; assert(fd >= 0); debugs(5, 5, HERE << "FD " << fd << ", type=" << type << ", handler=" << handler << ", client_data=" << client_data << ", timeout=" << timeout); - if (RUNNING_ON_VALGRIND) { - /* Keep valgrind happy.. complains about uninitialized bytes otherwise */ - memset(&ev, 0, sizeof(ev)); - } - ev.events = 0; + struct epoll_event ev; + memset(&ev, 0, sizeof(ev)); ev.data.fd = fd; if (!F->flags.open) { -- 2.47.3