]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
Avoid setting maxfiles for a remote asterisk
authorTzafrir Cohen <tzafrir.cohen@xorcom.com>
Mon, 3 Jul 2017 12:30:37 +0000 (15:30 +0300)
committerTzafrir Cohen <tzafrir.cohen@xorcom.com>
Tue, 11 Jul 2017 17:51:40 +0000 (12:51 -0500)
Setting maxfiles (maximum number of open files) has no practical
effect on a remote asterisk (rasterisk, rasterisk -x).

It has an ill effect of printing an extra message, which
may be annoying in case of -x.

ASTERISK-27105 #close

Change-Id: Iaf9eb344e4b4b517df91b736b27ec55f6a6921a2

main/asterisk.c

index e2562764aa86825d9eb4b2fae4fca6e6e50e0455..ac078dd7ac15be6b4bb727295863093611081cca 100644 (file)
@@ -3811,7 +3811,9 @@ static void ast_readconfig(void)
                /* Set the maximum amount of open files */
                } else if (!strcasecmp(v->name, "maxfiles")) {
                        ast_option_maxfiles = atoi(v->value);
-                       set_ulimit(ast_option_maxfiles);
+                       if (!ast_opt_remote) {
+                               set_ulimit(ast_option_maxfiles);
+                       }
                /* What user to run as */
                } else if (!strcasecmp(v->name, "runuser")) {
                        ast_copy_string(cfg_paths.run_user, v->value, sizeof(cfg_paths.run_user));