mail-index-fsck.c revision 6a1cb8bcac9b4dc7846ef19f2e7c53ecf37f1d55
/* Copyright (C) 2004 Timo Sirainen */
#include "lib.h"
#include "mail-index-private.h"
#include "mail-transaction-log.h"
const char *fmt, ...)
{
}
}
const char **error_r)
{
struct mail_index_header hdr;
const struct mail_index_record *rec;
/* locking already does the most important sanity checks for header */
*error_r = "uid_validity = 0 && next_uid != 1";
return 0;
}
hdr.messages_count = 0;
hdr.recent_messages_count = 0;
hdr.seen_messages_count = 0;
*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;
return 1;
}
{
const char *error;
unsigned int lock_id;
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 (lock_log)
}
if (ret == 0)
return ret;
}