mail-transaction-log.c revision 51b979b6414b940f04677a7e2d064be119345954
e5224c0589916fb22f95f959326cf4b6221715b0Timo Sirainen/* Copyright (C) 2003-2007 Timo Sirainen */
e5224c0589916fb22f95f959326cf4b6221715b0Timo Sirainen/* this lock should never exist for a long time.. */
e5224c0589916fb22f95f959326cf4b6221715b0Timo Sirainenmail_transaction_log_set_head(struct mail_transaction_log *log,
2ce0021487fbd7ef3384f3456fa4a176309c4ebfTimo Sirainen i_assert(log->files->next != NULL || log->files == file);
2ce0021487fbd7ef3384f3456fa4a176309c4ebfTimo Sirainenmail_transaction_log_alloc(struct mail_index *index)
2ce0021487fbd7ef3384f3456fa4a176309c4ebfTimo Sirainen log->dotlock_settings.use_excl_lock = index->use_excl_dotlocks;
e5224c0589916fb22f95f959326cf4b6221715b0Timo Sirainen log->dotlock_settings.timeout = LOG_DOTLOCK_TIMEOUT;
e5224c0589916fb22f95f959326cf4b6221715b0Timo Sirainen log->dotlock_settings.stale_timeout = LOG_DOTLOCK_STALE_TIMEOUT;
e5224c0589916fb22f95f959326cf4b6221715b0Timo Sirainen log->new_dotlock_settings = log->dotlock_settings;
e5224c0589916fb22f95f959326cf4b6221715b0Timo Sirainen log->new_dotlock_settings.lock_suffix = LOG_NEW_DOTLOCK_SUFFIX;
e5224c0589916fb22f95f959326cf4b6221715b0Timo Sirainenstatic void mail_transaction_log_2_unlink_old(struct mail_transaction_log *log)
e5224c0589916fb22f95f959326cf4b6221715b0Timo Sirainen if (st.st_mtime + MAIL_TRANSACTION_LOG2_STALE_SECS <= ioloop_time) {
e5224c0589916fb22f95f959326cf4b6221715b0Timo Sirainenint mail_transaction_log_open(struct mail_transaction_log *log)
e5224c0589916fb22f95f959326cf4b6221715b0Timo Sirainen mail_transaction_log_file_free(&log->open_file);
e5224c0589916fb22f95f959326cf4b6221715b0Timo Sirainen file = mail_transaction_log_file_alloc(log, path);
e5224c0589916fb22f95f959326cf4b6221715b0Timo Sirainen if ((ret = mail_transaction_log_file_open(file, FALSE)) <= 0) {
e5224c0589916fb22f95f959326cf4b6221715b0Timo Sirainen /* leave the file for _create() */
e5224c0589916fb22f95f959326cf4b6221715b0Timo Sirainenint mail_transaction_log_create(struct mail_transaction_log *log)
e5224c0589916fb22f95f959326cf4b6221715b0Timo Sirainen file = mail_transaction_log_file_alloc_in_memory(log);
if (reset) {
const char *path;
const char *path;
int ret;
return ret;
int ret = 0;
if (ret < 0)
return ret;