]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Epoll: initialize kdpfd and epoll_event in all cases
authorAmos Jeffries <squid3@treenet.co.nz>
Tue, 21 Apr 2015 14:20:23 +0000 (07:20 -0700)
committerAmos Jeffries <squid3@treenet.co.nz>
Tue, 21 Apr 2015 14:20:23 +0000 (07:20 -0700)
src/comm/ModEpoll.cc

index d3c731a9c6b8b05d24a06331f48c99bb648b139e..12fb2022923c1cfc4f0bf615a02a10240c27efdf 100644 (file)
@@ -49,7 +49,7 @@
 #include <sys/epoll.h>
 #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) {