From cca351db187fe92ec839b601a32e77eb63207a8d Mon Sep 17 00:00:00 2001 From: Timo Sirainen Date: Mon, 31 May 2010 19:09:41 +0100 Subject: [PATCH] lib-index: Try to handle index directory deletion more nicely. --HG-- branch : HEAD --- src/lib-index/mail-transaction-log.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/lib-index/mail-transaction-log.c b/src/lib-index/mail-transaction-log.c index f3a4f3d0d8..a878a4f5d6 100644 --- a/src/lib-index/mail-transaction-log.c +++ b/src/lib-index/mail-transaction-log.c @@ -306,6 +306,13 @@ mail_transaction_log_refresh(struct mail_transaction_log *log, bool nfs_flush) "stat()"); return -1; } + /* see if the whole directory got deleted */ + if (nfs_safe_stat(log->index->dir, &st) < 0 && + errno == ENOENT) { + log->index->index_deleted = TRUE; + return -1; + } + /* the file should always exist at this point. if it doesn't, someone deleted it manually while the index was open. try to handle this nicely by creating a new log file. */ -- 2.47.3