From 757f70de67ebae6a6a5f27105151974567df0d1c Mon Sep 17 00:00:00 2001 From: "geniusdex geniusdex@31f1291d-b8d6-0310-a050-a5561fc1590b" Date: Fri, 9 Sep 2005 21:20:16 +0000 Subject: BUILD : 1.7.10 (877) BUGS : NOTES : Added two more globops warnings when a database cannott be opened git-svn-id: svn://svn.anope.org/anope/trunk@877 31f1291d-b8d6-0310-a050-a5561fc1590b git-svn-id: http://anope.svn.sourceforge.net/svnroot/anope/trunk@624 5417fbe8-f217-4b02-8779-1006273d7864 --- Changes | 1 + src/datafiles.c | 12 ++++++++++++ version.log | 6 +++++- 3 files changed, 18 insertions(+), 1 deletion(-) diff --git a/Changes b/Changes index 8ed5fb874..31f287ab2 100644 --- a/Changes +++ b/Changes @@ -8,6 +8,7 @@ Provided by Anope Dev. - 2005 07/01 A Events for channel access/xop updates. [ #00] 06/26 A New module pack module: hs_request. [ #00] 06/03 A Protocol files can now fill mod_current_buffer with custom code. [#389] +09/09 F Giving some more error output when opening a database fails. [ #00] 09/04 F Protocol module for plexus called wrong UNSGLINE function. [ #00] 08/31 F Help for /os modlist had faulty 'limited to' information. [ #00] 08/30 F Changed UserKeys to RECOMMENDED instead of REQUIRED. [ #00] diff --git a/src/datafiles.c b/src/datafiles.c index 5ccbe95ee..117f2c32e 100644 --- a/src/datafiles.c +++ b/src/datafiles.c @@ -17,6 +17,7 @@ #include static int curday = 0; +static time_t lastwarn = 0; /*************************************************************************/ @@ -91,6 +92,12 @@ static dbFILE *open_db_read(const char *service, const char *filename) if (!f) { #ifndef NOT_MAIN log_perror("Can't read %s database %s", service, filename); + if (time(NULL) - lastwarn > WarningTimeout) { + anope_cmd_global(NULL, + "Write error on %s: Memory allocation failed", + filename); + lastwarn = time(NULL); + } #endif return NULL; } @@ -103,6 +110,11 @@ static dbFILE *open_db_read(const char *service, const char *filename) if (errno != ENOENT) log_perror("Can not read %s database %s", service, f->filename); + if (time(NULL) - lastwarn > WarningTimeout) { + anope_cmd_global(NULL, "Write error on %s: %s", f->filename, + strerror(errno)); + lastwarn = time(NULL); + } #endif free(f); errno = errno_save; diff --git a/version.log b/version.log index 2db132d39..a232853e1 100644 --- a/version.log +++ b/version.log @@ -8,10 +8,14 @@ VERSION_MAJOR="1" VERSION_MINOR="7" VERSION_PATCH="10" -VERSION_BUILD="876" +VERSION_BUILD="877" # $Log$ # +# BUILD : 1.7.10 (877) +# BUGS : +# NOTES : Added two more globops warnings when a database cannott be opened +# # BUILD : 1.7.10 (876) # BUGS : # NOTES : Added something about DevNull to the FAQ -- cgit