summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAdam <Adam@anope.org>2010-06-21 02:02:51 -0400
committerAdam <Adam@anope.org>2010-06-21 17:51:34 -0400
commit7956bd839c0dc809c8796387ab64a95271e768dd (patch)
treefe524104e9cd7a427a065a99ab29b474a6dfe588
parentf63aed908f4bbca7b89ce26a0116712fe01cf2f1 (diff)
Fixed db_plain to write databases on windows
-rw-r--r--src/core/db_plain.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/core/db_plain.cpp b/src/core/db_plain.cpp
index 7e699b0fb..23bc774a7 100644
--- a/src/core/db_plain.cpp
+++ b/src/core/db_plain.cpp
@@ -44,6 +44,7 @@ static void ReadDatabase(Module *m = NULL)
EventReturn MOD_RESULT;
MDType Type = MD_NONE;
+ db.clear();
db.open(DatabaseFile.c_str(), std::ios_base::in);
if (!db.is_open())
@@ -584,7 +585,7 @@ class DBPlain : public Module
{
ircdproto->SendGlobops(findbot(Config.s_OperServ), "Unable to backup database!");
Alog() << "Unable to back up database!";
-
+
if (!Config.NoBackupOkay)
quitting = 1;
@@ -928,6 +929,7 @@ class DBPlain : public Module
{
BackupDatabase();
+ db.clear();
db.open(DatabaseFile.c_str(), std::ios_base::out | std::ios_base::trunc);
if (!db.is_open())