Skip to content

Commit

Permalink
modules: quietly succeed at loading a module if already loaded
Browse files Browse the repository at this point in the history
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
  • Loading branch information
dwfreed authored and spb committed Jul 1, 2023
1 parent 7a2ccb0 commit cc95a67
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions ircd/modules.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
*c = '\0';

/* Quietly succeed if the module is already loaded */
if(findmodule_byname(mod_displayname) != NULL)
return true;

tmpptr = lt_dlopenext(path);

if(tmpptr == NULL)
Expand Down

0 comments on commit cc95a67

Please sign in to comment.