Browse code

os_support: fix poll() implementation

Our poll implementation does not iterate over the pollfd array properly
while setting the revents.

Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
(cherry picked from commit 9ac2085dbf1821b7995fe360038c1bf0f3940032)

Max Shakhmetov authored on 2011/02/16 01:49:27
Showing 1 changed files
... ...
@@ -292,7 +292,7 @@ int poll(struct pollfd *fds, nfds_t numfds, int timeout)
292 292
     if (rc < 0)
293 293
         return rc;
294 294
 
295
-    for(i = 0; i < (nfds_t) n; i++) {
295
+    for(i = 0; i < numfds; i++) {
296 296
         fds[i].revents = 0;
297 297
 
298 298
         if (FD_ISSET(fds[i].fd, &read_set))      fds[i].revents |= POLLIN;