diff options
-rw-r--r-- | src/coremods/core_oper/cmd_die.cpp | 9 | ||||
-rw-r--r-- | src/inspircd.cpp | 5 |
2 files changed, 9 insertions, 5 deletions
diff --git a/src/coremods/core_oper/cmd_die.cpp b/src/coremods/core_oper/cmd_die.cpp index 5a9415915..5e7a6afcf 100644 --- a/src/coremods/core_oper/cmd_die.cpp +++ b/src/coremods/core_oper/cmd_die.cpp @@ -29,6 +29,14 @@ CommandDie::CommandDie(Module* parent) syntax = "<password>"; } +static void QuitAll() +{ + const std::string quitmsg = "Server shutdown"; + const UserManager::LocalList& list = ServerInstance->Users.GetLocalUsers(); + while (!list.empty()) + ServerInstance->Users.QuitUser(list.front(), quitmsg); +} + /** Handle /DIE */ CmdResult CommandDie::Handle (const std::vector<std::string>& parameters, User *user) @@ -41,6 +49,7 @@ CmdResult CommandDie::Handle (const std::vector<std::string>& parameters, User * ServerInstance->SendError(diebuf); } + QuitAll(); ServerInstance->Exit(EXIT_STATUS_DIE); } else diff --git a/src/inspircd.cpp b/src/inspircd.cpp index 5dfcca6d9..fce99f421 100644 --- a/src/inspircd.cpp +++ b/src/inspircd.cpp @@ -108,11 +108,6 @@ void InspIRCd::Cleanup() } ports.clear(); - /* Close all client sockets, or the new process inherits them */ - const UserManager::LocalList& list = Users.GetLocalUsers(); - while (!list.empty()) - Users->QuitUser(list.front(), "Server shutdown"); - GlobalCulls.Apply(); Modules->UnloadAll(); |