diff options
Diffstat (limited to 'src/modules/m_permchannels.cpp')
-rw-r--r-- | src/modules/m_permchannels.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/modules/m_permchannels.cpp b/src/modules/m_permchannels.cpp index 6f67cc31d..40774e1fa 100644 --- a/src/modules/m_permchannels.cpp +++ b/src/modules/m_permchannels.cpp @@ -100,6 +100,14 @@ static bool WriteDatabase() return false; } +#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; + } +#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) { |