Hello Jenkins Builder,
I'd like you to reexamine a change. Please visit
https://gerrit.osmocom.org/1986
to look at the new patch set (#3).
select: Find the highest fd when filling the fd_sets
Instead of returning maxfd, which is the highest fd ever seen, take
the highest we have seen on this iteration.
This makes a tiny difference for the osmo-sip-connector and its
event loop integration. select.c ignores the return value of this
function right now.
This was seen while debugging the eventloop integration of the
osmo-sip-connector before and after a VTY connection. The fds
being polled didn't go down.
Change-Id: I1a6d7271273ec08bb511c21b936891bc508843e4
---
M src/select.c
1 file changed, 12 insertions(+), 1 deletion(-)
git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/86/1986/3
diff --git a/src/select.c b/src/select.c
index ab0734e..8ed7f1b 100644
--- a/src/select.c
+++ b/src/select.c
@@ -117,10 +117,18 @@
llist_del(>list);
}
+/*! \brief Populate the fd_sets and return the highest fd number
+ * \param[in] _rset The readfds to populate
+ * \param[in] _wset The wrtiefds to populate
+ * \param[in] _eset The errorfds to populate
+ *
+ * \returns The highest file descriptor seen or 0 on an empty list
+ */
inline int osmo_fd_fill_fds(void *_rset, void *_wset, void *_eset)
{
fd_set *readset = _rset, *writeset = _wset, *exceptset = _eset;
struct osmo_fd *ufd;
+ int highfd = 0;
llist_for_each_entry(ufd, _fds, list) {
if (ufd->when & BSC_FD_READ)
@@ -131,9 +139,12 @@
if (ufd->when & BSC_FD_EXCEPT)
FD_SET(ufd->fd, exceptset);
+
+ if (ufd->fd > highfd)
+ highfd = ufd->fd;
}
- return maxfd;
+ return highfd;
}
inline int osmo_fd_disp_fds(void *_rset, void *_wset, void *_eset)
--
To view, visit https://gerrit.osmocom.org/1986
To unsubscribe, visit https://gerrit.osmocom.org/settings
Gerrit-MessageType: newpatchset
Gerrit-Change-Id: I1a6d7271273ec08bb511c21b936891bc508843e4
Gerrit-PatchSet: 3
Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-Owner: Holger Freyther
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: Max