X-Git-Url: https://git.lttng.org/?p=lttng-tools.git;a=blobdiff_plain;f=src%2Fcommon%2Fcompat%2Fpoll.h;h=e3a13cedecfeda3768b2df2718ccf0e5af3b4d04;hp=bb046c3427af53f49a76997874a3d43b1808ba37;hb=e71aad1fa4b06a5f91ddceace42366f3d79bd77e;hpb=1af0e2e4d4a770e32f4fc169122b0c338bd799f6 diff --git a/src/common/compat/poll.h b/src/common/compat/poll.h index bb046c342..e3a13cede 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); } }