X-Git-Url: http://git.liburcu.org/?a=blobdiff_plain;f=src%2Fcommon%2Fcompat%2Fcompat-epoll.c;h=067ac124d83fa9bdaad196bf9a3b9893bf51d087;hb=dd0ab7509addfa62db59e255ea8fdd884505367d;hp=6259fd3895e46b9b27826944c1b7574b72b72ff3;hpb=4e8b3b0cd7565762eaa6601b5889f82c4eaef367;p=lttng-tools.git diff --git a/src/common/compat/compat-epoll.c b/src/common/compat/compat-epoll.c index 6259fd389..067ac124d 100644 --- a/src/common/compat/compat-epoll.c +++ b/src/common/compat/compat-epoll.c @@ -76,8 +76,9 @@ int compat_epoll_create(struct lttng_poll_event *events, int size, int flags) } if (!poll_max_size) { - ERR("poll_max_size not initialized yet"); - goto error; + if (lttng_poll_set_max_size()) { + goto error; + } } /* Don't bust the limit here */ @@ -259,7 +260,15 @@ int compat_epoll_set_max_size(void) fd = open(COMPAT_EPOLL_PROC_PATH, O_RDONLY); if (fd < 0) { - retval = -1; + /* + * Failing on opening [1] is not an error per see. [1] was + * introduced in Linux 2.6.28 but epoll is available since + * 2.5.44. Hence, goto end and set a default value without + * setting an error return value. + * + * [1] /proc/sys/fs/epoll/max_user_watches + */ + retval = 0; goto end; }