Add the capability to require a module to be loaded, or else Asterisk exits.

Review: https://reviewboard.asterisk.org/r/426/


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@229819 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
Olle Johansson
2009-11-13 08:52:28 +00:00
parent 8016a55636
commit 75c015bfff
4 changed files with 49 additions and 19 deletions

View File

@@ -3108,6 +3108,7 @@ int main(int argc, char *argv[])
char *buf;
const char *runuser = NULL, *rungroup = NULL;
char *remotesock = NULL;
int moduleresult; /*!< Result from the module load subsystem */
/* Remember original args for restart */
if (argc > ARRAY_LEN(_argv) - 1) {
@@ -3583,9 +3584,9 @@ int main(int argc, char *argv[])
ast_xmldoc_load_documentation();
#endif
if (load_modules(1)) { /* Load modules, pre-load only */
if ((moduleresult = load_modules(1))) { /* Load modules, pre-load only */
printf("%s", term_quit());
exit(1);
exit(moduleresult == -2 ? 2 : 1);
}
if (dnsmgr_init()) { /* Initialize the DNS manager */
@@ -3657,9 +3658,9 @@ int main(int argc, char *argv[])
exit(1);
}
if (load_modules(0)) {
if ((moduleresult = load_modules(0))) { /* Load modules */
printf("%s", term_quit());
exit(1);
exit(moduleresult == -2 ? 2 : 1);
}
/* loads the cli_permissoins.conf file needed to implement cli restrictions. */