]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/modules/m_permchannels.cpp
m_spanningtree Keep track of whether we've sent our burst, to be used for translation
[user/henk/code/inspircd.git] / src / modules / m_permchannels.cpp
index a4fc6bd099630c52851d49e87eddc3a2d1849449..60c4578c5053aea61c6166dd63a964f9a7fe62f1 100644 (file)
@@ -74,7 +74,8 @@ static bool WriteDatabase(PermChannel& permchanmode, Module* mod, bool save_list
        stream << "# This file is automatically generated by m_permchannels. Any changes will be overwritten." << std::endl
                << "<config format=\"xml\">" << std::endl;
 
-       for (chan_hash::const_iterator i = ServerInstance->chanlist->begin(); i != ServerInstance->chanlist->end(); i++)
+       const chan_hash& chans = ServerInstance->GetChans();
+       for (chan_hash::const_iterator i = chans.begin(); i != chans.end(); ++i)
        {
                Channel* chan = i->second;
                if (!chan->IsModeSet(permchanmode))
@@ -143,12 +144,7 @@ static bool WriteDatabase(PermChannel& permchanmode, Module* mod, bool save_list
        stream.close();
 
 #ifdef _WIN32
-       if (remove(permchannelsconf.c_str()))
-       {
-               ServerInstance->Logs->Log(MODNAME, LOG_DEFAULT, "Cannot remove old database! %s (%d)", strerror(errno), errno);
-               ServerInstance->SNO->WriteToSnoMask('a', "database: cannot remove old database: %s (%d)", strerror(errno), errno);
-               return false;
-       }
+       remove(permchannelsconf.c_str());
 #endif
        // Use rename to move temporary to new db - this is guarenteed not to fuck up, even in case of a crash.
        if (rename(permchannelsnewconf.c_str(), permchannelsconf.c_str()) < 0)