aboutsummaryrefslogtreecommitdiffstats
path: root/loader.c
diff options
context:
space:
mode:
authormarkster <markster@f38db490-d61c-443f-a65b-d21fe96a405b>2004-11-13 22:44:33 +0000
committermarkster <markster@f38db490-d61c-443f-a65b-d21fe96a405b>2004-11-13 22:44:33 +0000
commit0cb7e1d1213a736678db0461df98ffbc51bedf0e (patch)
tree993cb4342c122c30661869af3aa5adea2e357b7f /loader.c
parent7410ef70b13796d508a2a8e3a08d8a7ca7b7163c (diff)
Big agent / queue fixes
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@4231 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'loader.c')
-rwxr-xr-xloader.c15
1 files changed, 12 insertions, 3 deletions
diff --git a/loader.c b/loader.c
index 0f3876a2e..5280d5a50 100755
--- a/loader.c
+++ b/loader.c
@@ -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