[MERGED] osmo-sip-connector[master]: evpoll: Always initialize revents for the output

Harald Welte gerrit-no-reply at lists.osmocom.org
Mon Feb 13 22:09:12 UTC 2017


Harald Welte has submitted this change and it was merged.

Change subject: evpoll: Always initialize revents for the output
......................................................................


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
---
M src/evpoll.c
1 file changed, 2 insertions(+), 1 deletion(-)

Approvals:
  Harald Welte: Looks good to me, approved
  Jenkins Builder: Verified



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 @@
 	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))

-- 
To view, visit https://gerrit.osmocom.org/1796
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I9e16a6d5a74a204c85808ba67a8f0f7af3045059
Gerrit-PatchSet: 1
Gerrit-Project: osmo-sip-connector
Gerrit-Branch: master
Gerrit-Owner: Holger Freyther <holger at freyther.de>
Gerrit-Reviewer: Harald Welte <laforge at gnumonks.org>
Gerrit-Reviewer: Jenkins Builder


More information about the gerrit-log mailing list