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

This is merely a historical archive of years 2008-2021, before the migration to mailman3.

A maintained and still updated list archive can be found at https://lists.osmocom.org/hyperkitty/list/gerrit-log@lists.osmocom.org/.

Holger Freyther gerrit-no-reply at lists.osmocom.org
Sat Feb 11 06:09:32 UTC 2017


Review at  https://gerrit.osmocom.org/1796

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


  git pull ssh://gerrit.osmocom.org:29418/osmo-sip-connector refs/changes/96/1796/1

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: newchange
Gerrit-Change-Id: I9e16a6d5a74a204c85808ba67a8f0f7af3045059
Gerrit-PatchSet: 1
Gerrit-Project: osmo-sip-connector
Gerrit-Branch: master
Gerrit-Owner: Holger Freyther <holger at freyther.de>



More information about the gerrit-log mailing list