$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)
Fri Jul 10 1998 Art Cancro <ajc@uncensored.citadel.org>
* Initial CVS import
-
#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 */
u_int32_t flags;
int ret;
char **file, **list;
+ char errmsg[SIZ];
lprintf(5, "Database log file cull started.\n");
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);
}