mail-index-fsck.c revision 6ec7cf71ccd0eed1f9cc1b0bda8960796b04160b
/* Copyright (C) 2004-2007 Timo Sirainen */
#include "lib.h"
#include "ioloop.h"
#include "mail-index-private.h"
#include "mail-transaction-log.h"
const char *fmt, ...)
{
}
}
{
struct mail_index_header hdr;
bool records_dropped = FALSE;
if (*lock) {
&file_offset) < 0) {
return -1;
}
} else {
&file_offset);
}
/* Remember the log head position. If we go back in the index's head
offset, ignore errors in the log up to this offset. */
/* locking already does the most important sanity checks for header */
sizeof(struct mail_transaction_log_header);
} else {
}
hdr.messages_count = 0;
hdr.seen_messages_count = 0;
/* log an error once, and skip this record */
if (!logged_zero_uids) {
"Record UIDs have zeroes");
}
} else {
if (!logged_unordered_uids) {
"Record UIDs unordered");
}
}
/* not the fastest way when we're skipping lots of
records, but this should happen rarely so don't
bother optimizing. */
continue;
}
hdr.first_unseen_uid_lowwater == 0)
i++;
}
if (records_dropped) {
/* all existing views are broken now */
}
}
if (hdr.first_unseen_uid_lowwater == 0)
if (hdr.first_deleted_uid_lowwater == 0)
if (hdr.first_recent_uid == 0)
CHECK(log_file_seq, !=);
/* don't bother complaining about these if file changed too */
CHECK(log_file_head_offset, !=);
CHECK(log_file_tail_offset, !=);
}
CHECK(uid_validity, !=);
CHECK(messages_count, !=);
CHECK(seen_messages_count, !=);
CHECK(deleted_messages_count, !=);
CHECK(first_recent_uid, !=);
return 0;
}
{
struct mail_index_map *map;
int ret;
if (ret == 0) {
}
if (lock)
return ret;
}
{
int ret;
}