modules: quietly succeed at loading a module if already loaded

This allows explicitly loading a module in the config so it's available
for later config items that might need it, and skips the double load
when main loads all modules, which would cause errors
This commit is contained in:
Doug Freed 2023-06-22 23:11:35 +00:00 committed by Stephen Bennett
parent 7a2ccb077f
commit cc95a6722e

View file

@ -465,6 +465,10 @@ load_a_module(const char *path, bool warn, int origin, bool core)
if((c = rb_strcasestr(mod_displayname, LT_MODULE_EXT)) != NULL) if((c = rb_strcasestr(mod_displayname, LT_MODULE_EXT)) != NULL)
*c = '\0'; *c = '\0';
/* Quietly succeed if the module is already loaded */
if(findmodule_byname(mod_displayname) != NULL)
return true;
tmpptr = lt_dlopenext(path); tmpptr = lt_dlopenext(path);
if(tmpptr == NULL) if(tmpptr == NULL)