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:
William Ahern 2009-11-29 10:20:46 -05:00 committed by Nick Mathewson
parent 0cd3bb9f3a
commit 56771a3eed

View File

@ -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;