From: Fredrik Tolf Date: Fri, 28 Jan 2011 16:36:05 +0000 (+0100) Subject: lib: Clear the epoll event descriptor before use. X-Git-Tag: 0.6~9 X-Git-Url: http://www.dolda2000.com/gitweb/?p=ashd.git;a=commitdiff_plain;h=5ab220d943a861df1d8546a3ecebfddbd63494a2 lib: Clear the epoll event descriptor before use. --- diff --git a/lib/mtio.c b/lib/mtio.c index 367c61d..b65a8b0 100644 --- a/lib/mtio.c +++ b/lib/mtio.c @@ -63,7 +63,8 @@ static int regfd(struct blocker *bl) { struct blocker *o; struct epoll_event evd; - + + memset(&evd, 0, sizeof(evd)); evd.events = 0; if(bl->ev & EV_READ) evd.events |= EPOLLIN; @@ -124,6 +125,7 @@ static void remfd(struct blocker *bl) if(epoll_ctl(epfd, EPOLL_CTL_DEL, bl->fd, NULL)) flog(LOG_ERR, "epoll_del on fd %i: %s", bl->fd, strerror(errno)); } else { + memset(&evd, 0, sizeof(evd)); evd.events = 0; evd.data.fd = bl->fd; for(o = fdlist[bl->fd]; o; o = o->n2) {