Fix Valgrind warning in dill_pollset_poll: 'epoll_ctl(event) points to unitialized bytes'
@@ -109,6 +109,9 @@ int dill_pollset_in(struct dill_fdclause *fdcl, int id, int fd) {
add it to the pollset. */
if(dill_slow(!fdi->cached)) {
struct epoll_event ev;
+#ifdef DILL_VALGRIND
+ ev.data.u64 = 0; //Keep Valgrind happy
+#endif
ev.data.fd = fd;
ev.events = EPOLLIN;
int rc = epoll_ctl(ctx->efd, EPOLL_CTL_ADD, fd, &ev);
@@ -142,6 +145,9 @@ int dill_pollset_out(struct dill_fdclause *fdcl, int id, int fd) {
add it to pollset. */
if(dill_slow(!fdi->cached)) {
struct epoll_event ev;
+#ifdef DILL_VALGRIND
+ ev.data.u64 = 0; //Keep Valgrind happy
+#endif
ev.data.fd = fd;
ev.events = EPOLLOUT;
int rc = epoll_ctl(ctx->efd, EPOLL_CTL_ADD, fd, &ev);
@@ -176,6 +182,9 @@ int dill_pollset_clean(int fd) {
/* Remove the file descriptor from the pollset if it is still there. */
if(fdi->currevs) {
struct epoll_event ev;
+#ifdef DILL_VALGRIND
+ ev.data.u64 = 0; //Keep Valgrind happy
+#endif
ev.data.fd = fd;
ev.events = 0;
int rc = epoll_ctl(ctx->efd, EPOLL_CTL_DEL, fd, &ev);
@@ -206,6 +215,7 @@ int dill_pollset_poll(int timeout) {
int fd = ctx->changelist - 1;
struct dill_fdinfo *fdi = &ctx->fdinfos[fd];
struct epoll_event ev;
+ ev.data.u64 = 0; //Keep Valgrind happy
ev.data.fd = fd;
ev.events = 0;
if(fdi->in)
@@ -258,4 +268,3 @@ int dill_pollset_poll(int timeout) {
/* Return 0 on timeout or 1 if at least one coroutine was resumed. */
return numevs > 0 ? 1 : 0;
}
-
