mirror of
https://github.com/asterisk/asterisk.git
synced 2025-10-12 15:45:18 +00:00
Merged revisions 284597 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.8 ................ r284597 | tilghman | 2010-09-02 00:00:34 -0500 (Thu, 02 Sep 2010) | 29 lines Merged revisions 284593,284595 via svnmerge from https://origsvn.digium.com/svn/asterisk/branches/1.6.2 ................ r284593 | tilghman | 2010-09-01 17:59:50 -0500 (Wed, 01 Sep 2010) | 18 lines Merged revisions 284478 via svnmerge from https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r284478 | tilghman | 2010-09-01 13:49:11 -0500 (Wed, 01 Sep 2010) | 11 lines Ensure that all areas that previously used select(2) now use poll(2), with implementations that need poll(2) implemented with select(2) safe against 1024-bit overflows. This is a followup to the fix for the pthread timer in 1.6.2 and beyond, fixing a potential crash bug in all supported releases. (closes issue #17678) Reported by: russell Branch: https://origsvn.digium.com/svn/asterisk/team/tilghman/ast_select Review: https://reviewboard.asterisk.org/r/824/ ........ ................ r284595 | tilghman | 2010-09-01 22:57:43 -0500 (Wed, 01 Sep 2010) | 2 lines Failed to rerun bootstrap.sh after last commit ................ ................ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@284598 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
@@ -2232,44 +2232,6 @@ static inline void timersub(struct timeval *tvend, struct timeval *tvstart, stru
|
||||
}
|
||||
#endif
|
||||
|
||||
/*!
|
||||
* \brief Waits for activity on a group of channels
|
||||
* \param nfds the maximum number of file descriptors in the sets
|
||||
* \param rfds file descriptors to check for read availability
|
||||
* \param wfds file descriptors to check for write availability
|
||||
* \param efds file descriptors to check for exceptions (OOB data)
|
||||
* \param tvp timeout while waiting for events
|
||||
* \details
|
||||
* This is the same as a standard select(), except it guarantees the
|
||||
* behaviour where the passed struct timeval is updated with how much
|
||||
* time was not slept while waiting for the specified events
|
||||
*/
|
||||
static inline int ast_select(int nfds, fd_set *rfds, fd_set *wfds, fd_set *efds, struct timeval *tvp)
|
||||
{
|
||||
#ifdef __linux__
|
||||
return select(nfds, rfds, wfds, efds, tvp);
|
||||
#else
|
||||
if (tvp) {
|
||||
struct timeval tv, tvstart, tvend, tvlen;
|
||||
int res;
|
||||
|
||||
tv = *tvp;
|
||||
gettimeofday(&tvstart, NULL);
|
||||
res = select(nfds, rfds, wfds, efds, tvp);
|
||||
gettimeofday(&tvend, NULL);
|
||||
timersub(&tvend, &tvstart, &tvlen);
|
||||
timersub(&tv, &tvlen, tvp);
|
||||
if (tvp->tv_sec < 0 || (tvp->tv_sec == 0 && tvp->tv_usec < 0)) {
|
||||
tvp->tv_sec = 0;
|
||||
tvp->tv_usec = 0;
|
||||
}
|
||||
return res;
|
||||
}
|
||||
else
|
||||
return select(nfds, rfds, wfds, efds, NULL);
|
||||
#endif
|
||||
}
|
||||
|
||||
/*! \brief Retrieves the current T38 state of a channel */
|
||||
static inline enum ast_t38_state ast_channel_get_t38_state(struct ast_channel *chan)
|
||||
{
|
||||
|
Reference in New Issue
Block a user