mirror of
https://github.com/cuberite/libevent.git
synced 2025-09-09 12:28:19 -04:00
Valgrind fix: Clear struct kevent before checking for OSX bug.
William's original commit message: Valgrind complains on startup because kq_init passes to kevent only a partially initialized structure. The code doesn't expect kevent to look at .fflags, .udata, or .data, I suppose, because it merely tickles the kernel looking for an error response. But perhaps that's unwarranted chuminess (notwithstanding that it's checking for an OS X bug), and needless noise nonetheless.
This commit is contained in:
parent
0cd3bb9f3a
commit
56771a3eed
1
kqueue.c
1
kqueue.c
@ -146,6 +146,7 @@ kq_init(struct event_base *base)
|
||||
kqueueop->pend_changes_size = NEVENT;
|
||||
|
||||
/* Check for Mac OS X kqueue bug. */
|
||||
memset(&kqueueop->changes[0], 0, sizeof kqueueop->changes[0]);
|
||||
kqueueop->changes[0].ident = -1;
|
||||
kqueueop->changes[0].filter = EVFILT_READ;
|
||||
kqueueop->changes[0].flags = EV_ADD;
|
||||
|
Loading…
x
Reference in New Issue
Block a user