From: Jérémie Galarneau Date: Wed, 3 Aug 2016 18:14:33 +0000 (-0400) Subject: Fix: zero-initialize fd_set X-Git-Tag: v2.9.0-rc1~70 X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=e593ee026ebb70c2d0b1e789c9bb135748879a00;p=lttng-tools.git Fix: zero-initialize fd_set Signed-off-by: Jérémie Galarneau --- diff --git a/tests/regression/kernel/select_poll_epoll.c b/tests/regression/kernel/select_poll_epoll.c index 20988a370..dfb52370b 100644 --- a/tests/regression/kernel/select_poll_epoll.c +++ b/tests/regression/kernel/select_poll_epoll.c @@ -442,7 +442,7 @@ void ppoll_fds_ulong_max(void) */ void pselect_fd_too_big(void) { - long rfds[2048 / (sizeof(long) * CHAR_BIT)]; + long rfds[2048 / (sizeof(long) * CHAR_BIT)] = { 0 }; int ret; int fd2; char buf[BUF_SIZE]; @@ -456,7 +456,7 @@ void pselect_fd_too_big(void) perror("dup2"); return; } - FD_ZERO((fd_set *) &rfds); + FD_SET(fd2, (fd_set *) &rfds); ret = syscall(SYS_pselect6, fd2 + 1, &rfds, NULL, NULL, NULL, NULL);