diff options
author | Mark Spencer <markster@digium.com> | 2004-11-13 22:44:33 +0000 |
---|---|---|
committer | Mark Spencer <markster@digium.com> | 2004-11-13 22:44:33 +0000 |
commit | dffb2566bc83731dcd7d54d526fc73720380ba6d (patch) | |
tree | 993cb4342c122c30661869af3aa5adea2e357b7f /loader.c | |
parent | c75b3177579c9b393ae7432ef6d15402663e7e05 (diff) |
Big agent / queue fixes
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@4231 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'loader.c')
-rwxr-xr-x | loader.c | 15 |
1 files changed, 12 insertions, 3 deletions
@@ -408,6 +408,14 @@ static int ast_resource_exists(char *resource) return 0; } +static const char *loadorder[] = +{ + "res_", + "chan_", + "pbx_", + NULL, +}; + int load_modules() { struct ast_config *cfg; @@ -442,13 +450,14 @@ int load_modules() DIR *mods; struct dirent *d; int x; - /* Make two passes. First, load any resource modules, then load the others. */ - for (x=0;x<2;x++) { + /* Loop through each order */ + for (x=0;x<sizeof(loadorder) / sizeof(loadorder[0]);x++) { mods = opendir((char *)ast_config_AST_MODULE_DIR); if (mods) { while((d = readdir(mods))) { /* Must end in .so to load it. */ - if ((strlen(d->d_name) > 3) && (x || !strncasecmp(d->d_name, "res_", 4)) && + if ((strlen(d->d_name) > 3) && + (!loadorder[x] || !strncasecmp(d->d_name, loadorder[x], strlen(loadorder[x]))) && !strcasecmp(d->d_name + strlen(d->d_name) - 3, ".so") && !ast_resource_exists(d->d_name)) { /* It's a shared library -- Just be sure we're allowed to load it -- kinda |