modules: cleanups

This commit is contained in:
William Pitcock 2016-06-18 00:38:40 -05:00
parent 73b70ae846
commit 92dad4831d
3 changed files with 5 additions and 8 deletions

View file

@ -134,7 +134,7 @@ extern bool unload_one_module(const char *, bool);
extern bool load_one_module(const char *, int, bool); extern bool load_one_module(const char *, int, bool);
extern bool load_a_module(const char *, bool, int, bool); extern bool load_a_module(const char *, bool, int, bool);
extern int findmodule_byname(const char *); extern int findmodule_byname(const char *);
extern void modules_init(void); extern void init_modules(void);
/* Misc externs */ /* Misc externs */
extern struct module **modlist; extern struct module **modlist;

View file

@ -803,6 +803,7 @@ charybdis_main(int argc, char * const argv[])
init_authd(); /* Start up authd. */ init_authd(); /* Start up authd. */
init_dns(); /* Start up DNS query system */ init_dns(); /* Start up DNS query system */
init_modules(); /* Start up modules system */
privilegeset_set_new("default", "", 0); privilegeset_set_new("default", "", 0);
@ -810,8 +811,6 @@ charybdis_main(int argc, char * const argv[])
fprintf(stderr, "\nBeginning config test\n"); fprintf(stderr, "\nBeginning config test\n");
read_conf_files(true); /* cold start init conf files */ read_conf_files(true); /* cold start init conf files */
mod_add_path(MODULE_DIR);
mod_add_path(MODULE_DIR "/autoload");
load_all_modules(1); load_all_modules(1);
load_core_modules(1); load_core_modules(1);

View file

@ -72,7 +72,7 @@ int max_mods = MODS_INCREMENT;
static rb_dlink_list mod_paths; static rb_dlink_list mod_paths;
void void
modules_init(void) init_modules(void)
{ {
if(lt_dlinit()) if(lt_dlinit())
{ {
@ -80,6 +80,8 @@ modules_init(void)
exit(EXIT_FAILURE); exit(EXIT_FAILURE);
} }
modlist = (struct module **) rb_malloc(sizeof(struct module *) * (MODS_INCREMENT));
/* Add the default paths we look in to the module system --nenolod */ /* Add the default paths we look in to the module system --nenolod */
mod_add_path(ircd_paths[IRCD_PATH_MODULES]); mod_add_path(ircd_paths[IRCD_PATH_MODULES]);
mod_add_path(ircd_paths[IRCD_PATH_AUTOLOAD_MODULES]); mod_add_path(ircd_paths[IRCD_PATH_AUTOLOAD_MODULES]);
@ -188,10 +190,6 @@ load_all_modules(bool warn)
char module_fq_name[PATH_MAX + 1]; char module_fq_name[PATH_MAX + 1];
size_t module_ext_len = strlen(LT_MODULE_EXT); size_t module_ext_len = strlen(LT_MODULE_EXT);
modules_init();
modlist = (struct module **) rb_malloc(sizeof(struct module *) * (MODS_INCREMENT));
max_mods = MODS_INCREMENT; max_mods = MODS_INCREMENT;
system_module_dir = opendir(ircd_paths[IRCD_PATH_AUTOLOAD_MODULES]); system_module_dir = opendir(ircd_paths[IRCD_PATH_AUTOLOAD_MODULES]);