diff options
author | Adam <Adam@anope.org> | 2013-04-11 00:08:28 -0500 |
---|---|---|
committer | Adam <Adam@anope.org> | 2013-04-11 00:08:28 -0500 |
commit | 4f9b7874d6b3a41939ecc2e872ec08d03af7b5f1 (patch) | |
tree | 43162205d31b277c9ff12ee28b7e3a60d6382316 /modules/commands/os_reload.cpp | |
parent | 207c46c871e85b55ae66acc456c6bc412c0c79f9 (diff) |
Pass new config and the new config reader to the OnReload event, aswell as call it on module load on modules that hook to it
Diffstat (limited to 'modules/commands/os_reload.cpp')
-rw-r--r-- | modules/commands/os_reload.cpp | 13 |
1 files changed, 4 insertions, 9 deletions
diff --git a/modules/commands/os_reload.cpp b/modules/commands/os_reload.cpp index 86b3a040e..fcf3868fa 100644 --- a/modules/commands/os_reload.cpp +++ b/modules/commands/os_reload.cpp @@ -24,23 +24,18 @@ class CommandOSReload : public Command void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) anope_override { - ServerConfig *old_config = Config; - try { - Config = new ServerConfig(); - FOREACH_MOD(I_OnReload, OnReload()); - delete old_config; + ServerConfig *new_config = new ServerConfig(); + delete Config; + Config = new_config; source.Reply(_("Services' configuration file has been reloaded.")); } catch (const ConfigException &ex) { - Config = old_config; Log(this->owner) << "Error reloading configuration file: " << ex.GetReason(); - source.Reply(_("Error reloading configuration file: ") + ex.GetReason()); + source.Reply(_("Error reloading configuration file: %s"), ex.GetReason().c_str()); } - - return; } bool OnHelp(CommandSource &source, const Anope::string &subcommand) anope_override |