diff options
-rw-r--r-- | include/command_parse.h | 3 | ||||
-rw-r--r-- | src/command_parse.cpp | 8 |
2 files changed, 6 insertions, 5 deletions
diff --git a/include/command_parse.h b/include/command_parse.h index 2c883be20..4e25d1004 100644 --- a/include/command_parse.h +++ b/include/command_parse.h @@ -59,9 +59,10 @@ class CoreExport CommandParser : public classbase /** Finds the init_command symbol in a .so file * @param v A function pointer to be initialized * @param h A valid shared object handle + * @param name The filename being loaded, used for error reporting * @return True if the symbol could be found */ - bool FindSym(void** v, void* h); + bool FindSym(void** v, void* h, const std::string &name); /** A list of core-implemented modes and their shared object handles */ diff --git a/src/command_parse.cpp b/src/command_parse.cpp index c273e0859..e751db6d3 100644 --- a/src/command_parse.cpp +++ b/src/command_parse.cpp @@ -458,13 +458,13 @@ CommandParser::CommandParser(InspIRCd* Instance) : ServerInstance(Instance) para.resize(128); } -bool CommandParser::FindSym(void** v, void* h) +bool CommandParser::FindSym(void** v, void* h, const std::string &name) { *v = dlsym(h, "init_command"); const char* err = dlerror(); if (err && !(*v)) { - ServerInstance->Log(SPARSE, "Error loading core command: %s\n", err); + ServerInstance->Log(SPARSE, "Error loading core command %s: %s\n", name, err); return false; } return true; @@ -546,11 +546,11 @@ const char* CommandParser::LoadCommand(const char* name) if (!h) { const char* n = dlerror(); - ServerInstance->Log(SPARSE, "Error loading core command: %s", n); + ServerInstance->Log(SPARSE, "Error loading core command %s: %s", name, n); return n; } - if (this->FindSym((void **)&cmd_factory_func, h)) + if (this->FindSym((void **)&cmd_factory_func, h, name)) { command_t* newcommand = cmd_factory_func(ServerInstance); this->CreateCommand(newcommand, h); |