aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--main/Makefile1
-rw-r--r--main/app.c2
2 files changed, 2 insertions, 1 deletions
diff --git a/main/Makefile b/main/Makefile
index 53c83a0ab..4e74186ce 100644
--- a/main/Makefile
+++ b/main/Makefile
@@ -61,6 +61,7 @@ ifneq ($(findstring darwin,$(OSARCH)),)
ifneq ($(findstring LOADABLE_MODULES,$(MENUSELECT_CFLAGS)),)
ASTLINK=-Wl,-dynamic
endif
+ ASTLINK+=-Xlinker -macosx_version_min -Xlinker 10.4 -Xlinker -undefined -Xlinker dynamic_lookup -force_flat_namespace
else
# These are used for all but Darwin
ifneq ($(findstring LOADABLE_MODULES,$(MENUSELECT_CFLAGS)),)
diff --git a/main/app.c b/main/app.c
index 46cacbd46..14cabe026 100644
--- a/main/app.c
+++ b/main/app.c
@@ -1988,7 +1988,7 @@ void ast_close_fds_above_n(int n)
struct rlimit rl;
getrlimit(RLIMIT_NOFILE, &rl);
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) {
/* Side effect of dup2 is that it closes any existing fd without error.
* This prevents valgrind and other debugging tools from sending up