[Asterisk-cvs] asterisk/include/asterisk channel.h,1.42,1.43
markster at lists.digium.com
markster at lists.digium.com
Sun Apr 25 16:37:00 CDT 2004
Update of /usr/cvsroot/asterisk/include/asterisk
In directory mongoose.digium.com:/tmp/cvs-serv23905/include/asterisk
Modified Files:
channel.h
Log Message:
Properly migrate from select to poll for core asterisk.
Index: channel.h
===================================================================
RCS file: /usr/cvsroot/asterisk/include/asterisk/channel.h,v
retrieving revision 1.42
retrieving revision 1.43
diff -u -d -r1.42 -r1.43
--- channel.h 6 Apr 2004 22:17:32 -0000 1.42
+++ channel.h 25 Apr 2004 20:42:45 -0000 1.43
@@ -20,6 +20,7 @@
#include <unistd.h>
#include <setjmp.h>
#include <pthread.h>
+#include <sys/poll.h>
#if defined(__cplusplus) || defined(c_plusplus)
extern "C" {
@@ -780,6 +781,21 @@
int ast_do_masquerade(struct ast_channel *chan);
/* Misc. functions below */
+
+/* Helper function for migrating select to poll */
+static inline int ast_fdisset(struct pollfd *pfds, int fd, int max, int *start)
+{
+ int x;
+ for (x=start ? *start : 0;x<max;x++)
+ if (pfds[x].fd == fd) {
+ if (start) {
+ if (x==*start)
+ (*start)++;
+ }
+ return pfds[x].revents;
+ }
+ return 0;
+}
//! Waits for activity on a group of channels
/*!
More information about the svn-commits
mailing list