gstpoll: Fix for (p)select backend
authorEdward Hervey <edward.hervey@collabora.co.uk>
Mon, 3 Jan 2011 19:19:05 +0000 (20:19 +0100)
committerEdward Hervey <edward.hervey@collabora.co.uk>
Mon, 3 Jan 2011 19:37:59 +0000 (20:37 +0100)
We need to reset the revents field of each pollfd when reading the results
from select else we'll end up with stray info from previous calls to
select.

gst/gstpoll.c

index af34f66..95be70e 100644 (file)
@@ -376,6 +376,7 @@ fd_set_to_pollfd (GstPoll * set, fd_set * readfds, fd_set * writefds,
     struct pollfd *pfd = &g_array_index (set->active_fds, struct pollfd, i);
 
     if (pfd->fd < FD_SETSIZE) {
+      pfd->revents = 0;
       if (FD_ISSET (pfd->fd, readfds))
         pfd->revents |= POLLIN;
       if (FD_ISSET (pfd->fd, writefds))