From: Jonathan Rajotte Date: Tue, 9 May 2017 19:46:35 +0000 (-0400) Subject: Fix: COMPAT_EPOLL_PROC_PATH is available from Linux 2.6.28 X-Git-Tag: v2.11.0-rc1~587 X-Git-Url: https://git.lttng.org/?p=lttng-tools.git;a=commitdiff_plain;h=d3f531ff12fe7b5c2533cbfc6862b686f460da2d Fix: COMPAT_EPOLL_PROC_PATH is available from Linux 2.6.28 v2: Typo in commit message "per see" -> "per se" Failing on opening [1] is not an error per se. [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 error return value. [1] /proc/sys/fs/epoll/max_user_watches Signed-off-by: Jonathan Rajotte Signed-off-by: Jérémie Galarneau --- diff --git a/src/common/compat/compat-epoll.c b/src/common/compat/compat-epoll.c index dbaf68233..6a781c7ae 100644 --- a/src/common/compat/compat-epoll.c +++ b/src/common/compat/compat-epoll.c @@ -301,7 +301,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; }