]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/inspircd.cpp
Allow Channel::WriteNotice send to other servers and status ranks.
[user/henk/code/inspircd.git] / src / inspircd.cpp
index c5d958f8788b4cf59c350282e4dd4a9f8fc602e6..f35482f618a975d48373385b31f4cf5edd8fde73 100644 (file)
@@ -30,7 +30,6 @@
 #include <signal.h>
 
 #ifndef _WIN32
-       #include <dirent.h>
        #include <unistd.h>
        #include <sys/resource.h>
        #include <dlfcn.h>
@@ -94,8 +93,11 @@ void InspIRCd::Cleanup()
        }
        ports.clear();
 
-       // Disconnect all local users
+       // Tell modules that we're shutting down.
        const std::string quitmsg = "Server shutting down";
+       FOREACH_MOD(OnShutdown, (quitmsg));
+
+       // Disconnect all local users
        const UserManager::LocalList& list = Users.GetLocalUsers();
        while (!list.empty())
                ServerInstance->Users.QuitUser(list.front(), quitmsg);
@@ -191,9 +193,7 @@ void InspIRCd::WritePID(const std::string& filename, bool exitonfail)
                return;
        }
 
-       std::string fname(filename);
-       if (fname.empty())
-               fname = ServerInstance->Config->Paths.PrependData("inspircd.pid");
+       std::string fname = ServerInstance->Config->Paths.PrependData(filename.empty() ? "inspircd.pid" : filename);
        std::ofstream outfile(fname.c_str());
        if (outfile.is_open())
        {