Fix: COMPAT_EPOLL_PROC_PATH is available from Linux 2.6.28
authorJonathan Rajotte <jonathan.rajotte-julien@efficios.com>
Tue, 9 May 2017 19:46:35 +0000 (15:46 -0400)
committerJérémie Galarneau <jeremie.galarneau@efficios.com>
Thu, 11 May 2017 13:35:25 +0000 (09:35 -0400)
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 <jonathan.rajotte-julien@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
src/common/compat/compat-epoll.c

index dbaf6823364eb5e4444ba536ac0291300a527a0a..6a781c7ae04034f321f974c244df6e43e01e58b3 100644 (file)
@@ -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;
        }
 
This page took 0.038508 seconds and 4 git commands to generate.