From: Amos Jeffries Date: Tue, 21 Apr 2015 14:20:23 +0000 (-0700) Subject: Epoll: initialize kdpfd and epoll_event in all cases X-Git-Tag: merge-candidate-3-v1~164 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=612fc4743d2ebc2cff9d904877e3607edbf571e2;p=thirdparty%2Fsquid.git Epoll: initialize kdpfd and epoll_event in all cases --- 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) {