Fix: force the poll() return value to be nb_fd
[lttng-tools.git] / src / common / compat / compat-epoll.c
index e58497232a130c002940cd1ffeb5b879129d47b7..e1672c4c3178afbbce32acddebf2b30cea66fe09 100644 (file)
@@ -43,7 +43,7 @@ int compat_epoll_create(struct lttng_poll_event *events, int size, int flags)
        }
 
        /* Don't bust the limit here */
-       if (size > poll_max_size) {
+       if (size > poll_max_size && poll_max_size != 0) {
                size = poll_max_size;
        }
 
@@ -188,6 +188,10 @@ int compat_epoll_wait(struct lttng_poll_event *events, int timeout)
                goto error;
        }
 
+       /*
+        * Since the returned events are set sequentially in the "events" structure
+        * we only need to return the epoll_wait value and iterate over it.
+        */
        return ret;
 
 error:
This page took 0.023261 seconds and 4 git commands to generate.