diff options
author | DukePyrolator <DukePyrolator@anope.org> | 2012-03-22 07:30:38 +0100 |
---|---|---|
committer | DukePyrolator <DukePyrolator@anope.org> | 2012-03-22 07:30:38 +0100 |
commit | 8d0b4a1bf53788494fe0531dd62b4dd2ee655e9b (patch) | |
tree | 6ed18d1d79c43293975abf068e4bc697ffe1dbd2 /src | |
parent | 1b0ebcadfa1003b8e2d873a572633e4d1c0286de (diff) |
added a missing error message when a module file does not exist. this fixes bug #1401. also moved some debug messages to debug level 2
Diffstat (limited to 'src')
-rw-r--r-- | src/modulemanager.cpp | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/src/modulemanager.cpp b/src/modulemanager.cpp index 6837f7d1f..dd41d3940 100644 --- a/src/modulemanager.cpp +++ b/src/modulemanager.cpp @@ -80,7 +80,7 @@ static ModuleReturn moduleCopyFile(const Anope::string &name, Anope::string &out output = tmp_output; free(tmp_output); - Log(LOG_DEBUG) << "Runtime module location: " << output; + Log(LOG_DEBUG_2) << "Runtime module location: " << output; std::ofstream target(output.c_str(), std::ios_base::in | std::ios_base::binary); if (!target.is_open()) @@ -139,7 +139,13 @@ ModuleReturn ModuleManager::LoadModule(const Anope::string &modname, User *u) /* Don't skip return value checking! -GD */ ModuleReturn ret = moduleCopyFile(modname, pbuf); if (ret != MOD_ERR_OK) + { + if (ret == MOD_ERR_NOEXIST) + Log(LOG_TERMINAL) << "Error while loading " << modname << " (file not exists)"; + else if (ret == MOD_ERR_FILE_IO) + Log(LOG_TERMINAL) << "Error while loading " << modname << " (file IO error, check file permissions and diskspace)"; return ret; + } dlerror(); void *handle = dlopen(pbuf.c_str(), RTLD_LAZY); @@ -209,7 +215,7 @@ ModuleReturn ModuleManager::LoadModule(const Anope::string &modname, User *u) return MOD_ERR_VERSION; } else - Log(LOG_DEBUG) << "Module " << modname << " is compiled against current version of Anope " << Anope::VersionShort(); + Log(LOG_DEBUG_2) << "Module " << modname << " is compiled against current version of Anope " << Anope::VersionShort(); if (m->type == PROTOCOL && ModuleManager::FindFirstOf(PROTOCOL) != m) { @@ -217,7 +223,7 @@ ModuleReturn ModuleManager::LoadModule(const Anope::string &modname, User *u) Log() << "You cannot load two protocol modules"; return MOD_ERR_UNKNOWN; } - + Log(LOG_DEBUG) << "Module loaded."; FOREACH_MOD(I_OnModuleLoad, OnModuleLoad(u, m)); return MOD_ERR_OK; |