summaryrefslogtreecommitdiff
path: root/src/datafiles.c
diff options
context:
space:
mode:
authormark mark@31f1291d-b8d6-0310-a050-a5561fc1590b <mark mark@31f1291d-b8d6-0310-a050-a5561fc1590b@5417fbe8-f217-4b02-8779-1006273d7864>2007-06-04 13:04:05 +0000
committermark mark@31f1291d-b8d6-0310-a050-a5561fc1590b <mark mark@31f1291d-b8d6-0310-a050-a5561fc1590b@5417fbe8-f217-4b02-8779-1006273d7864>2007-06-04 13:04:05 +0000
commit0bdd730f3cfb306f8d1b05bb215693677ecf04ba (patch)
treec4341fb17fb8d667da16917fd75aa2b77bda53f6 /src/datafiles.c
parent42703a0e5e493d068387abb691d3142bd5b3b65d (diff)
BUILD : 1.7.18 (1244) BUGS : 713 719 NOTES : Corrected typo in rdb.c, added code in backup_databases() and remove_backups() to backup the prenick db, and added checks in remove_backups() for s_BotServ and s_HostServ being NULL
git-svn-id: svn://svn.anope.org/anope/trunk@1244 31f1291d-b8d6-0310-a050-a5561fc1590b git-svn-id: http://anope.svn.sourceforge.net/svnroot/anope/trunk@963 5417fbe8-f217-4b02-8779-1006273d7864
Diffstat (limited to 'src/datafiles.c')
-rw-r--r--src/datafiles.c34
1 files changed, 25 insertions, 9 deletions
diff --git a/src/datafiles.c b/src/datafiles.c
index b49780687..b42566848 100644
--- a/src/datafiles.c
+++ b/src/datafiles.c
@@ -619,12 +619,6 @@ static void remove_backups(void)
#else
DeleteFile(path);
#endif
- snprintf(path, sizeof(path), "backups/%s.%s", BotDBName, ext);
-#ifndef _WIN32
- unlink(path);
-#else
- DeleteFile(path);
-#endif
snprintf(path, sizeof(path), "backups/%s.%s", ChanDBName, ext);
#ifndef _WIN32
unlink(path);
@@ -649,12 +643,31 @@ static void remove_backups(void)
#else
DeleteFile(path);
#endif
- snprintf(path, sizeof(path), "backups/%s.%s", HostDBName, ext);
+
+ if (s_BotServ) {
+ snprintf(path, sizeof(path), "backups/%s.%s", BotDBName, ext);
#ifndef _WIN32
- unlink(path);
+ unlink(path);
#else
- DeleteFile(path);
+ DeleteFile(path);
+#endif
+ }
+ if (s_HostServ) {
+ snprintf(path, sizeof(path), "backups/%s.%s", HostDBName, ext);
+#ifndef _WIN32
+ unlink(path);
+#else
+ DeleteFile(path);
#endif
+ }
+ if (NSEmailReg) {
+ snprintf(path, sizeof(path), "backups/%s.%s", PreNickDBName, ext);
+#ifndef _WIN32
+ unlink(path);
+#else
+ DeleteFile(path);
+#endif
+ }
}
/*************************************************************************/
@@ -703,6 +716,9 @@ void backup_databases(void)
if (s_HostServ) {
rename_database(HostDBName, ext);
}
+ if (NSEmailReg) {
+ rename_database(PreNickDBName, ext);
+ }
}
rename_database(OperDBName, ext);