diff options
author | Holger Hans Peter Freyther <holger@moiji-mobile.com> | 2017-02-11 13:01:12 +0700 |
---|---|---|
committer | Holger Hans Peter Freyther <holger@moiji-mobile.com> | 2017-02-11 13:01:12 +0700 |
commit | e19f9ce39fdf299944da41d754c78e34e86611af (patch) | |
tree | 4980343a4b71d86c553190cf336b0d708af1c129 | |
parent | 70926c8bb545139882f176c1893ca30363aa0956 (diff) |
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
-rw-r--r-- | src/evpoll.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/evpoll.c b/src/evpoll.c index 1648080..a4b8a80 100644 --- a/src/evpoll.c +++ b/src/evpoll.c @@ -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)) |