va_list args;
va_start(args, reason);
- mail_storage_set_critical(&file->storage->storage,
+ file->storage->v.set_file_corrupted(file, t_strdup_printf(
"Corrupted dbox file %s (around offset=%"PRIuUOFF_T"): %s",
file->cur_path, file->input == NULL ? 0 : file->input->v_offset,
- t_strdup_vprintf(reason, args));
+ t_strdup_vprintf(reason, args)));
va_end(args);
-
- file->storage->v.set_file_corrupted(file);
}
void dbox_file_init(struct dbox_file *file)
/* mark the mailbox corrupted */
void (*set_mailbox_corrupted)(struct mailbox *box);
/* mark the file corrupted */
- void (*set_file_corrupted)(struct dbox_file *file);
+ void (*set_file_corrupted)(struct dbox_file *file, const char *reason);
};
struct dbox_storage {
mdbox_storage_set_corrupted(mstorage);
}
-void mdbox_set_file_corrupted(struct dbox_file *file)
+void mdbox_set_file_corrupted(struct dbox_file *file, const char *reason)
{
struct mdbox_storage *mstorage = MDBOX_DBOX_STORAGE(file->storage);
+ mail_storage_set_critical(&mstorage->storage.storage, "%s", reason);
mdbox_storage_set_corrupted(mstorage);
}
void mdbox_storage_set_corrupted(struct mdbox_storage *storage);
void mdbox_set_mailbox_corrupted(struct mailbox *box);
-void mdbox_set_file_corrupted(struct dbox_file *file);
+void mdbox_set_file_corrupted(struct dbox_file *file, const char *reason);
#endif
mbox->corrupted_rebuild_count = hdr.rebuild_count;
}
-static void sdbox_set_file_corrupted(struct dbox_file *_file)
+static void sdbox_set_file_corrupted(struct dbox_file *_file,
+ const char *reason)
{
struct sdbox_file *file = (struct sdbox_file *)_file;
+ mail_storage_set_critical(&_file->storage->storage, "%s", reason);
sdbox_set_mailbox_corrupted(&file->mbox->box);
}