mirror of
https://github.com/asterisk/asterisk.git
synced 2025-09-05 12:16:00 +00:00
Close up to the soft open file limit (same on Linux, but varies drastically on OS X).
Also, a Makefile fix for Darwin (OS X). (closes issue #14542) Reported by: jtodd Patches: 20090901__issue14542.diff.txt uploaded by tilghman (license 14) Tested by: jtodd, tilghman Change-type: bugfix git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@215567 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
@@ -44,7 +44,7 @@ endif
|
|||||||
|
|
||||||
ifneq ($(findstring darwin,$(OSARCH)),)
|
ifneq ($(findstring darwin,$(OSARCH)),)
|
||||||
AST_LIBS+=-lresolv
|
AST_LIBS+=-lresolv
|
||||||
ASTLINK=-undefined suppress -force_flat_namespace
|
ASTLINK=-Xlinker -macosx_version_min -Xlinker 10.4 -Xlinker -undefined -Xlinker dynamic_lookup -force_flat_namespace
|
||||||
else
|
else
|
||||||
# These are used for all but Darwin
|
# These are used for all but Darwin
|
||||||
ifneq ($(findstring LOADABLE_MODULES,$(MENUSELECT_CFLAGS)),)
|
ifneq ($(findstring LOADABLE_MODULES,$(MENUSELECT_CFLAGS)),)
|
||||||
|
@@ -2015,7 +2015,7 @@ void ast_close_fds_above_n(int n)
|
|||||||
struct rlimit rl;
|
struct rlimit rl;
|
||||||
getrlimit(RLIMIT_NOFILE, &rl);
|
getrlimit(RLIMIT_NOFILE, &rl);
|
||||||
null = open("/dev/null", O_RDONLY);
|
null = open("/dev/null", O_RDONLY);
|
||||||
for (x = n + 1; x < rl.rlim_max; x++) {
|
for (x = n + 1; x < rl.rlim_cur; x++) {
|
||||||
if (x != null) {
|
if (x != null) {
|
||||||
/* Side effect of dup2 is that it closes any existing fd without error.
|
/* Side effect of dup2 is that it closes any existing fd without error.
|
||||||
* This prevents valgrind and other debugging tools from sending up
|
* This prevents valgrind and other debugging tools from sending up
|
||||||
|
Reference in New Issue
Block a user