]> jfr.im git - solanum.git/commitdiff
modules: quietly succeed at loading a module if already loaded
authorDoug Freed <redacted>
Thu, 22 Jun 2023 23:11:35 +0000 (23:11 +0000)
committerStephen Bennett <redacted>
Sat, 1 Jul 2023 18:23:56 +0000 (19:23 +0100)
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

ircd/modules.c

index 2af84083b14824fa484f3d8e0b3896b4258a3706..93e43acca4deaa6bb6f4744ba0c56d502c61fde3 100644 (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)
                *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)