aboutsummaryrefslogtreecommitdiffstats
path: root/src/modules/m_permchannels.cpp
diff options
context:
space:
mode:
authorGravatar Adam2014-05-08 19:40:13 -0400
committerGravatar Adam2014-05-08 19:57:08 -0400
commitbe5e83759fc2fbb00d59efa12857f48739522242 (patch)
tree9739c422dd08e8f7a692114ac738de9d81a6f48b /src/modules/m_permchannels.cpp
parentDo not export callers (diff)
downloadinspircd++-be5e83759fc2fbb00d59efa12857f48739522242.tar.gz
inspircd++-be5e83759fc2fbb00d59efa12857f48739522242.tar.bz2
inspircd++-be5e83759fc2fbb00d59efa12857f48739522242.zip
Fix m_permchannels and m_xline_db on Windows
The call to remove() can fail if the database doesn't already exist. Just ignore the error, which effectively makes the rename() call below work as it does on nix
Diffstat (limited to 'src/modules/m_permchannels.cpp')
-rw-r--r--src/modules/m_permchannels.cpp7
1 files changed, 1 insertions, 6 deletions
diff --git a/src/modules/m_permchannels.cpp b/src/modules/m_permchannels.cpp
index 69a282637..e86b3cbf6 100644
--- a/src/modules/m_permchannels.cpp
+++ b/src/modules/m_permchannels.cpp
@@ -156,12 +156,7 @@ static bool WriteDatabase(Module* mod, bool save_listmodes)
}
#ifdef _WIN32
- if (remove(permchannelsconf.c_str()))
- {
- ServerInstance->Logs->Log("m_permchannels",DEFAULT, "permchannels: 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(tempname.c_str(), permchannelsconf.c_str()) < 0)