aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--main/app.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/main/app.c b/main/app.c
index befc8ac32..0aa0b7ee9 100644
--- a/main/app.c
+++ b/main/app.c
@@ -2017,6 +2017,10 @@ void ast_close_fds_above_n(int n)
closedir(dir);
} else {
getrlimit(RLIMIT_NOFILE, &rl);
+ if (rl.rlim_cur > 65535) {
+ /* A more reasonable value */
+ rl.rlim_cur = 65535;
+ }
null = open("/dev/null", O_RDONLY);
for (x = n + 1; x < rl.rlim_cur; x++) {
if (x != null) {