Fix EEXIST handling on epoll_ctl add
authorDavid Goulet <dgoulet@efficios.com>
Thu, 2 Feb 2012 16:47:37 +0000 (11:47 -0500)
committerDavid Goulet <dgoulet@efficios.com>
Thu, 2 Feb 2012 16:47:37 +0000 (11:47 -0500)
Creating a second channel on the kernel tracer triggers a
update_kernel_poll which iterates over all channels and add the file
descriptors to the epoll set. Collision occurs with the first previously
added channel so EEXIST is acceptable and we simply do not perror() to
keep the session daemon stderr clean.

Signed-off-by: David Goulet <dgoulet@efficios.com>
src/common/compat/compat-epoll.c

index dc1a3b92689904ff4cbc8db49e3d5a3a353b0dcb..77f5b922abcb7bc03c90ce8f574f5f4c94a9e6ed 100644 (file)
@@ -93,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. */
This page took 0.027 seconds and 5 git commands to generate.