mirror of
https://github.com/haproxy/haproxy.git
synced 2026-04-21 14:17:30 -04:00
MINOR: epoll: always initialize all of epoll_event to please valgrind
valgrind complains that epoll_ctl() uses an epoll_event in which we have only set the part we use from the data field (i.e. the fd). Tests show that pre-initializing the struct in the stack doesn't have a measurable impact so let's do it.
This commit is contained in:
parent
c1563e5474
commit
55c5399846
1 changed files with 1 additions and 2 deletions
|
|
@ -61,7 +61,7 @@ static void __fd_clo(int fd)
|
|||
static void _update_fd(int fd)
|
||||
{
|
||||
int en, opcode;
|
||||
struct epoll_event ev;
|
||||
struct epoll_event ev = { };
|
||||
|
||||
en = fdtab[fd].state;
|
||||
|
||||
|
|
@ -120,7 +120,6 @@ static void _update_fd(int fd)
|
|||
}
|
||||
|
||||
/* construct the epoll events based on new state */
|
||||
ev.events = 0;
|
||||
if (en & FD_EV_ACTIVE_R)
|
||||
ev.events |= EPOLLIN | EPOLLRDHUP;
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue