diff options
author | Olle Johansson <oej@edvina.net> | 2009-11-13 08:52:28 +0000 |
---|---|---|
committer | Olle Johansson <oej@edvina.net> | 2009-11-13 08:52:28 +0000 |
commit | 75c015bfff61eae423b6b88882ddbe7052c09083 (patch) | |
tree | 367664686c054bc8c6ca330e9a4562a5d66384c2 /main/asterisk.c | |
parent | 8016a556364e4113b02059b53548b36c6d03bb8f (diff) |
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
Diffstat (limited to 'main/asterisk.c')
-rw-r--r-- | main/asterisk.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/main/asterisk.c b/main/asterisk.c index ea231d40e..22bfe7e76 100644 --- a/main/asterisk.c +++ b/main/asterisk.c @@ -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. */ |