aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormmichelson <mmichelson@f38db490-d61c-443f-a65b-d21fe96a405b>2008-07-28 19:53:56 +0000
committermmichelson <mmichelson@f38db490-d61c-443f-a65b-d21fe96a405b>2008-07-28 19:53:56 +0000
commitd1ae07e8e7b4772ea0767357c66a18e2be45b28d (patch)
tree7979e811b4a0d72d680fe0cc2681c8477def34df
parentaa5fc8c25632317394c2afcb46a20323900ad793 (diff)
This commit compensates for buggy poll(2)
implementations. Asterisk has, for a long time, had its own implementation of poll(2) which just used the input arguments to call select(2). In 1.4, this internal implementation was used for Darwin systems. This was removed in Asterisk trunk at some point, but it seems as though this was not the right move to make. On Mac OS X, it appears as though the poll used to gather CLI input does not respond properly when connecting via a remote Asterisk console. Reverting to the use of Asterisk's poll fixed the issue. Also, there is now an option for the configure script, --enable-internal-poll, which will allow for anyone to use Asterisk's internal poll implementation in case they suspect that their system's poll implementation is buggy. closes issue #11928) Reported by: adriavidal Patches: 1.6.0-configurev2.patch uploaded by putnopvut (license 60) git-svn-id: http://svn.digium.com/svn/asterisk/trunk@134125 f38db490-d61c-443f-a65b-d21fe96a405b
-rw-r--r--CHANGES6
-rwxr-xr-xconfigure17
-rw-r--r--configure.ac10
-rw-r--r--main/Makefile5
4 files changed, 37 insertions, 1 deletions
diff --git a/CHANGES b/CHANGES
index 27813f0bc..28b224ad3 100644
--- a/CHANGES
+++ b/CHANGES
@@ -818,3 +818,9 @@ Miscellaneous
as a backtrace of the stack which led to the lock calls.
* users.conf now sports an optional alternateexts property, which permits
allocation of additional extensions which will reach the specified user.
+ * A new option for the configure script, --enable-internal-poll, has been added
+ for use with systems which may have a buggy implementation of the poll system
+ call. If you notice odd behavior such as the CLI being unresponsive on remote
+ consoles, you may want to try using this option. This option is enabled by default
+ on Darwin systems since it is known that the Darwin poll() implementation has
+ odd issues.
diff --git a/configure b/configure
index d2bd5419c..070d777d3 100755
--- a/configure
+++ b/configure
@@ -1,5 +1,5 @@
#! /bin/sh
-# From configure.ac Revision: 132643 .
+# From configure.ac Revision: 132705 .
# Guess values for system-dependent variables and create Makefiles.
# Generated by GNU Autoconf 2.61 for asterisk 1.6.
#
@@ -1578,6 +1578,7 @@ Optional Features:
--enable-FEATURE[=ARG] include FEATURE [ARG=yes]
--enable-dev-mode Turn on developer mode
--disable-largefile omit support for large files
+ --enable-internal-poll Use Asterisk's poll implementation
Optional Packages:
--with-PACKAGE[=ARG] use PACKAGE [ARG=yes]
@@ -15597,6 +15598,20 @@ fi
+# Check whether --enable-internal-poll was given.
+if test "${enable_internal_poll+set}" = set; then
+ enableval=$enable_internal_poll; case "${enableval}" in
+ y|ye|yes) HAS_POLL="";;
+ n|no) HAS_POLL="${HAS_POLL}" ;;
+ *) { { echo "$as_me:$LINENO: error: bad value ${enableval} for --enable-internal-poll" >&5
+echo "$as_me: error: bad value ${enableval} for --enable-internal-poll" >&2;}
+ { (exit 1); exit 1; }; } ;;
+ esac
+fi
+
+
+
+
# https support (in main/http.c) uses funopen on BSD systems,
# fopencookie on linux
diff --git a/configure.ac b/configure.ac
index 0d7c306e5..3715edb56 100644
--- a/configure.ac
+++ b/configure.ac
@@ -327,8 +327,18 @@ AC_CHECK_HEADER([sys/poll.h],
[HAS_POLL=1]
AC_DEFINE([HAVE_SYS_POLL_H], 1, [Define to 1 if your system has working sys/poll.h]),
)
+
+AC_ARG_ENABLE(internal-poll,
+ [ --enable-internal-poll Use Asterisk's poll implementation],
+ [case "${enableval}" in
+ y|ye|yes) HAS_POLL="";;
+ n|no) HAS_POLL="${HAS_POLL}" ;;
+ *) AC_MSG_ERROR(bad value ${enableval} for --enable-internal-poll) ;;
+ esac])
AC_SUBST(HAS_POLL)
+
+
# https support (in main/http.c) uses funopen on BSD systems,
# fopencookie on linux
AC_CHECK_FUNCS([funopen fopencookie])
diff --git a/main/Makefile b/main/Makefile
index c27095f74..ddecb0b37 100644
--- a/main/Makefile
+++ b/main/Makefile
@@ -42,8 +42,13 @@ OBJS+=say.o
AST_LIBS += $(SSL_LIB)
AST_LIBS += $(BKTR_LIB)
+
ifeq ($(POLL_AVAILABLE),)
OBJS+=poll.o
+else
+ ifneq ($(findstring darwin,$(OSARCH)),)
+ OBJS+=poll.o
+ endif
endif
ifneq ($(findstring $(OSARCH), linux-gnu uclinux linux-uclibc linux-gnueabi ),)