mbox-transaction.c revision 8ef44bc339434cbc94a8e9383b2badf6a3ff4757
/* Copyright (c) 2004-2007 Dovecot authors, see the included COPYING file */
#include "lib.h"
#include "array.h"
#include "mbox-storage.h"
#include "mbox-lock.h"
#include "mbox-sync-private.h"
static void (*next_hook_mail_index_transaction_created)
(struct mail_index_transaction *t) = NULL;
static int mbox_transaction_commit(struct mail_index_transaction *t,
{
bool mails_saved;
int ret = 0;
if (ret < 0)
else {
log_file_offset_r) < 0)
ret = -1;
}
/* transaction is destroyed now. */
/* unlock before writing any changes */
lock_id = 0;
}
if (ret == 0 && mails_saved) {
/* after saving mails we want to update the last-uid */
ret = -1;
}
if (lock_id != 0) {
ret = -1;
}
return ret;
}
static void mbox_transaction_rollback(struct mail_index_transaction *t)
{
if (mt->mbox_lock_id != 0)
}
static void mbox_transaction_created(struct mail_index_transaction *t)
{
/* index can be for mailbox list index, in which case box=NULL */
struct mbox_transaction_context *mt;
t->v.commit = mbox_transaction_commit;
t->v.rollback = mbox_transaction_rollback;
}
}
void mbox_transaction_class_init(void)
{
}
void mbox_transaction_class_deinit(void)
{
}