ITS#6030 don't reload already loaded modules

This commit is contained in:
Howard Chu 2009-03-23 11:38:24 +00:00
parent ae3fb6acfa
commit fdda1ea70f

View file

@ -119,7 +119,7 @@ int module_unload( const char *file_name )
int module_load(const char* file_name, int argc, char *argv[]) int module_load(const char* file_name, int argc, char *argv[])
{ {
module_loaded_t *module = NULL; module_loaded_t *module;
const char *error; const char *error;
int rc; int rc;
MODULE_INIT_FN initialize; MODULE_INIT_FN initialize;
@ -129,6 +129,11 @@ int module_load(const char* file_name, int argc, char *argv[])
#define file file_name #define file file_name
#endif #endif
/* silently ignore attempts to load a module that's already present */
module = module_handle( file_name );
if ( module )
return 0;
module = (module_loaded_t *)ch_calloc(1, sizeof(module_loaded_t) + module = (module_loaded_t *)ch_calloc(1, sizeof(module_loaded_t) +
strlen(file_name)); strlen(file_name));
if (module == NULL) { if (module == NULL) {