1 From 31059dee4a706bb4f25f3dccaae7616451eabd8b Mon Sep 17 00:00:00 2001
2 From: Andrew Tridgell <tridge@samba.org>
3 Date: Wed, 17 Feb 2010 10:59:42 +1100
4 Subject: [PATCH 2/5] prevent a valgrind uninitialised memory warning
6 epoll uses a union, so to prevent passing uninitialised data in a
7 syscall we need to zero it before use.
9 lib/isc/unix/socket.c | 2 ++
10 1 files changed, 2 insertions(+), 0 deletions(-)
12 diff --git a/lib/isc/unix/socket.c b/lib/isc/unix/socket.c
13 index d09fe51..4796ee4 100644
14 --- a/lib/isc/unix/socket.c
15 +++ b/lib/isc/unix/socket.c
16 @@ -652,6 +652,7 @@ watch_fd(isc_socketmgr_t *manager, int fd, int msg) {
17 event.events = EPOLLIN;
19 event.events = EPOLLOUT;
20 + memset(&event.data, 0, sizeof(event.data));
22 if (epoll_ctl(manager->epoll_fd, EPOLL_CTL_ADD, fd, &event) == -1 &&
24 @@ -719,6 +720,7 @@ unwatch_fd(isc_socketmgr_t *manager, int fd, int msg) {
25 event.events = EPOLLIN;
27 event.events = EPOLLOUT;
28 + memset(&event.data, 0, sizeof(event.data));
30 if (epoll_ctl(manager->epoll_fd, EPOLL_CTL_DEL, fd, &event) == -1 &&