Merged revisions 285962 via svnmerge from

https://origsvn.digium.com/svn/asterisk/branches/1.8

................
  r285962 | tilghman | 2010-09-10 00:32:18 -0500 (Fri, 10 Sep 2010) | 13 lines
  
  Merged revisions 285961 via svnmerge from 
  https://origsvn.digium.com/svn/asterisk/branches/1.6.2
  
  ........
    r285961 | tilghman | 2010-09-10 00:31:31 -0500 (Fri, 10 Sep 2010) | 6 lines
    
    Another fix for Mac OS X.
    
    While trying to fix this the "right" way, I wandered into dependency hell.  Two
    hours later, I backed out, and just removed the offending code.  ast_inline_api
    only goes one level deep and then it breaks.  Ouch.
  ........
................


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@285963 65c4cc65-6c06-0410-ace0-fbb531ad65f3
10-digiumphones
Tilghman Lesher 15 years ago
parent 336d2a1abd
commit 57efeb40a6

@ -23,10 +23,11 @@
#ifndef __AST_SELECT_H #ifndef __AST_SELECT_H
#define __AST_SELECT_H #define __AST_SELECT_H
#include "asterisk/autoconfig.h" #include <sys/time.h>
#include <sys/select.h> #include <sys/select.h>
#include <errno.h> #include <errno.h>
#include "asterisk/utils.h"
#include "asterisk/compat.h"
#ifdef __cplusplus #ifdef __cplusplus
extern "C" { extern "C" {
@ -57,7 +58,7 @@ typedef struct {
if (fd / sizeof(*bytes) + ((fd + 1) % sizeof(*bytes) ? 1 : 0) < sizeof(*(fds))) { \ if (fd / sizeof(*bytes) + ((fd + 1) % sizeof(*bytes) ? 1 : 0) < sizeof(*(fds))) { \
bytes[fd / (sizeof(*bytes) * 8)] |= ((TYPEOF_FD_SET_FDS_BITS) 1) << (fd % (sizeof(*bytes) * 8)); \ bytes[fd / (sizeof(*bytes) * 8)] |= ((TYPEOF_FD_SET_FDS_BITS) 1) << (fd % (sizeof(*bytes) * 8)); \
} else { \ } else { \
ast_log(LOG_ERROR, "FD %d exceeds the maximum size of ast_fdset!\n", fd); \ fprintf(stderr, "FD %d exceeds the maximum size of ast_fdset!\n", fd); \
} \ } \
} while (0) } while (0)
#endif /* HAVE_VARIABLE_FDSET */ #endif /* HAVE_VARIABLE_FDSET */
@ -75,12 +76,9 @@ typedef struct {
static inline int ast_select(int nfds, ast_fdset *rfds, ast_fdset *wfds, ast_fdset *efds, struct timeval *tvp) static inline int ast_select(int nfds, ast_fdset *rfds, ast_fdset *wfds, ast_fdset *efds, struct timeval *tvp)
{ {
#ifdef __linux__ #ifdef __linux__
ast_assert((unsigned int) nfds <= ast_FD_SETSIZE);
return select(nfds, (fd_set *) rfds, (fd_set *) wfds, (fd_set *) efds, tvp); return select(nfds, (fd_set *) rfds, (fd_set *) wfds, (fd_set *) efds, tvp);
#else #else
int save_errno = 0; int save_errno = 0;
ast_assert((unsigned int) nfds <= ast_FD_SETSIZE);
if (tvp) { if (tvp) {
struct timeval tv, tvstart, tvend, tvlen; struct timeval tv, tvstart, tvend, tvlen;
int res; int res;

Loading…
Cancel
Save