aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorrussell <russell@f38db490-d61c-443f-a65b-d21fe96a405b>2010-09-22 16:39:16 +0000
committerrussell <russell@f38db490-d61c-443f-a65b-d21fe96a405b>2010-09-22 16:39:16 +0000
commit0ff9e0d042aead4110957f4e152886f576e8ddb9 (patch)
tree526a9dc63b3a6af0e228883dee22294ddd01f3c5
parent861856ff284efce33b3695c18dc4f647c16d64f2 (diff)
Fix a 100% CPU consumption problem when setting console=yes in asterisk.conf.
The handling of -c and console=yes should be the same, but they were not. When you specify -c, it sets both a flag for console module and for asterisk not to fork() off into the background. The handling of console=yes only set console mode, so you would end up with a background process() trying to run the Asterisk console and freaking out since it didn't have anything to read input from. Thanks to beagles for reporting and helping debug the problem! git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@288339 f38db490-d61c-443f-a65b-d21fe96a405b
-rw-r--r--main/asterisk.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/main/asterisk.c b/main/asterisk.c
index b0e4581d1..a5fd88a05 100644
--- a/main/asterisk.c
+++ b/main/asterisk.c
@@ -2625,7 +2625,7 @@ static void ast_readconfig(void)
ast_set2_flag(&ast_options, ast_true(v->value), AST_OPT_FLAG_QUIET);
/* Run as console (-c at startup, implies nofork) */
} else if (!strcasecmp(v->name, "console")) {
- ast_set2_flag(&ast_options, ast_true(v->value), AST_OPT_FLAG_CONSOLE);
+ ast_set2_flag(&ast_options, ast_true(v->value), AST_OPT_FLAG_NO_FORK | AST_OPT_FLAG_CONSOLE);
/* Run with high priority if the O/S permits (-p at startup) */
} else if (!strcasecmp(v->name, "highpriority")) {
ast_set2_flag(&ast_options, ast_true(v->value), AST_OPT_FLAG_HIGH_PRIORITY);