X-Git-Url: https://git.liburcu.org/?a=blobdiff_plain;f=src%2Fcommon%2Fcompat%2Fcompat-epoll.c;h=f4befa1a2a510fbdbb00825d87ad70f80e57200f;hb=811b2f150aae06ae0d211dc97416b847986798a3;hp=58f50cc94dd83e33448ca31ebdb2fd2594fee88a;hpb=890d8fe47755c3bad936389cf48ffa141cff41c9;p=lttng-tools.git diff --git a/src/common/compat/compat-epoll.c b/src/common/compat/compat-epoll.c index 58f50cc94..f4befa1a2 100644 --- a/src/common/compat/compat-epoll.c +++ b/src/common/compat/compat-epoll.c @@ -208,7 +208,6 @@ int compat_epoll_wait(struct lttng_poll_event *events, int timeout) ERR("Wrong arguments in compat_epoll_wait"); goto error; } - assert(events->nb_fd >= 0); if (events->nb_fd == 0) { errno = EINVAL; @@ -260,7 +259,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; }