Merge branch 'master' of git://git.lttng.org/lttng-tools
[lttng-tools.git] / src / common / compat / compat-epoll.c
index 5e969ee01115896f1286297966d22d94f216efb1..77f5b922abcb7bc03c90ce8f574f5f4c94a9e6ed 100644 (file)
@@ -23,7 +23,8 @@
 #include <unistd.h>
 #include <config.h>
 
-#include <common/lttngerr.h>
+#include <common/error.h>
+#include <common/defaults.h>
 
 #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);
This page took 0.025836 seconds and 4 git commands to generate.