From: David Goulet Date: Thu, 2 Feb 2012 16:47:37 +0000 (-0500) Subject: Fix EEXIST handling on epoll_ctl add X-Git-Tag: v2.0-pre19~4 X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=b7a6b49fe81863865644ca6ead51c23df927f83d;p=lttng-tools.git Fix EEXIST handling on epoll_ctl add 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 --- diff --git a/src/common/compat/compat-epoll.c b/src/common/compat/compat-epoll.c index dc1a3b926..77f5b922a 100644 --- a/src/common/compat/compat-epoll.c +++ b/src/common/compat/compat-epoll.c @@ -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. */