evpoll: Always initialize revents for the output

Even if we have not selected the fd (e.g. fd < 0), initialize revents
to 0. This seems to match gpoll.c:g_poll of glib.

Change-Id: I9e16a6d5a74a204c85808ba67a8f0f7af3045059
This commit is contained in:
Holger Hans Peter Freyther 2017-02-11 13:01:12 +07:00
parent 70926c8bb5
commit e19f9ce39f
1 changed files with 2 additions and 1 deletions

View File

@ -92,10 +92,11 @@ int evpoll(struct pollfd *fds, nfds_t nfds, int timeout)
osmo_fd_disp_fds(&readset, &writeset, &exceptset);
for (i = 0; i < nfds; ++i) {
fds[i].revents = 0;
if (fds[i].fd < 0)
continue;
fds[i].revents = 0;
if (FD_ISSET(fds[i].fd, &readset))
fds[i].revents = POLLIN;
if (FD_ISSET(fds[i].fd, &writeset))