From: Mathieu Desnoyers Date: Mon, 5 Jan 2015 21:43:04 +0000 (-0500) Subject: Fix: various compat poll/epoll issues X-Git-Url: https://git.lttng.org/?p=lttng-tools.git;a=commitdiff_plain;h=dbe23f452a025e8f42bdbb41e30a4a6257aa821c;hp=dbe23f452a025e8f42bdbb41e30a4a6257aa821c Fix: various compat poll/epoll issues poll: - fix two nb_fd off by one in "add", - simplify array size calculation, - add error checking, - compress the content of array before resizing it on "del" (out-of-bound memory access issue), - set wait.nb_fd = 0 when no FD are present in array on wait, - remove need_realloc flag: this can be checked internally by comparing current->alloc_size and wait->alloc_size. Minimize the number of duplicated state. epoll: - add error checking, - simplify array size calculation (make it similar to poll), - Set default size when poll_max_size is 0 within compat_epoll_set_max_size(), which allow better error checking elsewhere in epoll compat code. Fixes #747 Signed-off-by: Mathieu Desnoyers Signed-off-by: Jérémie Galarneau ---