[Asterisk-cvs] asterisk loader.c,1.19,1.20
markster at lists.digium.com
markster at lists.digium.com
Wed Apr 14 17:07:18 CDT 2004
Update of /usr/cvsroot/asterisk
In directory mongoose.digium.com:/tmp/cvs-serv28704
Modified Files:
loader.c
Log Message:
Store modules in the order they're loaded to make reload work properly
Index: loader.c
===================================================================
RCS file: /usr/cvsroot/asterisk/loader.c,v
retrieving revision 1.19
retrieving revision 1.20
diff -u -d -r1.19 -r1.20
--- loader.c 19 Feb 2004 01:04:21 -0000 1.19
+++ loader.c 14 Apr 2004 21:10:00 -0000 1.20
@@ -305,9 +305,22 @@
if (option_verbose)
ast_verbose(VERBOSE_PREFIX_1 "Loaded %s => (%s)\n", fn, m->description());
}
- m->next = module_list;
+
+ // add module 'm' to end of module_list chain
+ // so reload commands will be issued in same order modules were loaded
+ m->next = NULL;
+ if (module_list == NULL) {
+ // empty list so far, add at front
+ module_list = m;
+ }
+ else {
+ struct module *i;
+ // find end of chain, and add there
+ for (i = module_list; i->next; i = i->next)
+ ;
+ i->next = m;
+ }
- module_list = m;
ast_mutex_unlock(&modlock);
if ((res = m->load_module())) {
ast_log(LOG_WARNING, "%s: load_module failed, returning %d\n", m->resource, res);
More information about the svn-commits
mailing list