mail-index-fsck.c revision 633e6afa5de9ad8108ff8dbdee889ecf6170026e
/* Copyright (C) 2004 Timo Sirainen */
#include "lib.h"
#include "mail-index-private.h"
#include "mail-transaction-log.h"
const char *fmt, ...)
{
}
}
static void
{
"log_file_int_offset > log_file_ext_offset");
}
hdr->log_file_ext_offset))) {
"log file sync pos %u,%u -> %u, %"PRIuUOFF_T,
}
}
static int
const char **error_r)
{
struct mail_index_header hdr;
const struct mail_index_record *rec;
unsigned int records_count;
/* locking already does the most important sanity checks for header */
*error_r = "uid_validity = 0 && next_uid != 1";
return 0;
}
if (!index->log_locked)
else {
}
hdr.messages_count = 0;
hdr.recent_messages_count = 0;
hdr.seen_messages_count = 0;
for (i = 0; i < map->records_count; i++) {
*error_r = "Record UIDs are not ordered";
return 0;
}
hdr.first_recent_uid_lowwater == 0)
hdr.first_unseen_uid_lowwater == 0)
}
}
if (hdr.first_recent_uid_lowwater == 0)
if (hdr.first_unseen_uid_lowwater == 0)
if (hdr.first_deleted_uid_lowwater == 0)
CHECK(messages_count, !=);
CHECK(recent_messages_count, !=);
CHECK(seen_messages_count, !=);
CHECK(deleted_messages_count, !=);
return 1;
}
{
const char *error;
unsigned int lock_id;
int ret;
bool lock_log;
if (index->sync_update) {
/* we're modifying index, don't do anything */
return 1;
}
if (lock_log) {
&file_offset) < 0)
return -1;
}
return -1;
}
if (ret > 0) {
if (ret > 0) {
ret = -1;
}
}
if (lock_log)
}
if (ret == 0)
return ret;
}