X-Git-Url: https://git.lttng.org/?a=blobdiff_plain;f=src%2Fcommon%2Fcompat%2Fcompat-epoll.c;h=77f5b922abcb7bc03c90ce8f574f5f4c94a9e6ed;hb=b7a6b49fe81863865644ca6ead51c23df927f83d;hp=5e969ee01115896f1286297966d22d94f216efb1;hpb=0ba98ebc83bf874d34c8c84b164a6ad803e9de75;p=lttng-tools.git diff --git a/src/common/compat/compat-epoll.c b/src/common/compat/compat-epoll.c index 5e969ee01..77f5b922a 100644 --- a/src/common/compat/compat-epoll.c +++ b/src/common/compat/compat-epoll.c @@ -23,7 +23,8 @@ #include #include -#include +#include +#include #include "poll.h" @@ -92,6 +93,8 @@ int compat_epoll_add(struct lttng_poll_event *events, int fd, uint32_t req_event if (ret < 0) { switch (errno) { case EEXIST: + /* If exist, it's OK. */ + goto end; case ENOSPC: case EPERM: /* Print perror and goto end not failing. Show must go on. */ @@ -195,9 +198,9 @@ void compat_epoll_set_max_size(void) int ret, fd; char buf[64]; - poll_max_size = LTTNG_POLL_DEFAULT_SIZE; + poll_max_size = DEFAULT_POLL_SIZE; - fd = open(LTTNG_EPOLL_PROC_PATH, O_RDONLY); + fd = open(COMPAT_EPOLL_PROC_PATH, O_RDONLY); if (fd < 0) { return; } @@ -211,7 +214,7 @@ void compat_epoll_set_max_size(void) poll_max_size = atoi(buf); if (poll_max_size <= 0) { /* Extra precaution */ - poll_max_size = LTTNG_POLL_DEFAULT_SIZE; + poll_max_size = DEFAULT_POLL_SIZE; } DBG("epoll set max size is %d", poll_max_size);