Dolda2000 GitWeb
/
ashd.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
16accb8
)
lib: Clear the epoll event descriptor before use.
author
Fredrik Tolf
<fredrik@dolda2000.com>
Fri, 28 Jan 2011 16:36:05 +0000
(17:36 +0100)
committer
Fredrik Tolf
<fredrik@dolda2000.com>
Fri, 28 Jan 2011 16:36:05 +0000
(17:36 +0100)
lib/mtio.c
patch
|
blob
|
blame
|
history
diff --git
a/lib/mtio.c
b/lib/mtio.c
index
367c61d
..
b65a8b0
100644
(file)
--- 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) {