]> code.citadel.org Git - citadel.git/commitdiff
* Post an error message to Aide> when unlink() is unable to delete old
authorArt Cancro <ajc@citadel.org>
Sat, 16 Mar 2002 05:22:59 +0000 (05:22 +0000)
committerArt Cancro <ajc@citadel.org>
Sat, 16 Mar 2002 05:22:59 +0000 (05:22 +0000)
  database log files.

citadel/ChangeLog
citadel/database_sleepycat.c

index e366b9222671d150f623b1b1825ff5c9863bcf47..9e80bfd7107851993f89807a5820de4fc09eeaf7 100644 (file)
@@ -1,4 +1,8 @@
  $Log$
+ Revision 590.155  2002/03/16 05:22:59  ajc
+ * Post an error message to Aide> when unlink() is unable to delete old
+   database log files.
+
  Revision 590.154  2002/03/14 04:35:26  nbryant
  avoid symbol clash with curses' "timeout" function (which may be a macro
  in some versions)
@@ -3509,4 +3513,3 @@ Sat Jul 11 00:20:48 EDT 1998 Nathan Bryant <bryant@cs.usm.maine.edu>
 
 Fri Jul 10 1998 Art Cancro <ajc@uncensored.citadel.org>
        * Initial CVS import 
-
index 77a7daaf6192c5ac3a69777102c71d37dfdffcdd..e93c653f20c3121a62ce27d79cf751c8076f2e7b 100644 (file)
@@ -49,6 +49,7 @@
 #include "dynloader.h"
 #include "citserver.h"
 #include "database.h"
+#include "msgbase.h"
 #include "sysdep_decls.h"
 
 static DB *dbp[MAXCDB];                /* One DB handle for each Citadel database */
@@ -187,6 +188,7 @@ static void cdb_cull_logs(void) {
        u_int32_t flags;
        int ret;
        char **file, **list;
+       char errmsg[SIZ];
 
        lprintf(5, "Database log file cull started.\n");
 
@@ -208,7 +210,19 @@ static void cdb_cull_logs(void) {
        if (list != NULL) {
                for (file = list; *file != NULL; ++file) {
                        lprintf(9, "Deleting log: %s\n", *file);
-                       unlink(*file);
+                       ret = unlink(*file);
+                       if (ret != 0) {
+                               snprintf(errmsg, sizeof(errmsg),
+                                       " ** ERROR **\n \n \n "
+                                       "Citadel was unable to delete the "
+                                       "database log file '%s' because of the "
+                                       "following error:\n \n %s\n \n"
+                                       " This log file is no longer in use "
+                                       "and may be safely deleted.\n",
+                                       *file,
+                                       strerror(errno));
+                               aide_message(errmsg);
+                       }
                }
                free(list);
        }