aboutsummaryrefslogtreecommitdiffstats
path: root/main
diff options
context:
space:
mode:
authortilghman <tilghman@f38db490-d61c-443f-a65b-d21fe96a405b>2010-04-30 06:22:14 +0000
committertilghman <tilghman@f38db490-d61c-443f-a65b-d21fe96a405b>2010-04-30 06:22:14 +0000
commit191f21556dc274a3785c5a3f21cecf5d75a48ae6 (patch)
treebdf003d1df6a87e98dd3fa014a55bcca405e42cd /main
parent420fa7c1449b126280e40af855be33c961cc67b8 (diff)
Merged revisions 260292 via svnmerge from
https://origsvn.digium.com/svn/asterisk/trunk ........ r260292 | tilghman | 2010-04-30 01:19:35 -0500 (Fri, 30 Apr 2010) | 13 lines Don't allow file descriptors to go above 64k, when we're closing them in a fork(2). This saves time, when, even though the system allows the process limit to be that high, the practical limit is much lower. (closes issue #17223) Reported by: dbackeberg Patches: 20100423__issue17223.diff.txt uploaded by tilghman (license 14) Tested by: dbackeberg ........ git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.6.2@260303 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'main')
-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) {