X-Git-Url: https://git.lttng.org/?p=lttng-tools.git;a=blobdiff_plain;f=src%2Fcommon%2Fcompat%2Fpoll.h;h=7af2ef050bdbf9339b0aa2243ea30ab2f2c18ddb;hp=1580a4fb211a24def1146d7ec5c721431c34e3b4;hb=76d7553fcee76da7c103c3b51a6b01f46cd784c8;hpb=a4b35e07e4711a49f764c3783aae22d7f0a33d65 diff --git a/src/common/compat/poll.h b/src/common/compat/poll.h index 1580a4fb2..7af2ef050 100644 --- a/src/common/compat/poll.h +++ b/src/common/compat/poll.h @@ -50,6 +50,7 @@ static inline void __lttng_poll_free(void *events) */ #ifdef HAVE_EPOLL #include +#include /* See man epoll(7) for this define path */ #define COMPAT_EPOLL_PROC_PATH "/proc/sys/fs/epoll/max_user_watches" @@ -146,8 +147,13 @@ static inline void lttng_poll_reset(struct lttng_poll_event *events) */ static inline void lttng_poll_clean(struct lttng_poll_event *events) { + int ret; + if (events) { - close(events->epfd); + ret = close(events->epfd); + if (ret) { + perror("close"); + } __lttng_poll_free((void *) events->events); } }