]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
lib-index: Try to handle index directory deletion more nicely.
authorTimo Sirainen <tss@iki.fi>
Mon, 31 May 2010 18:09:41 +0000 (19:09 +0100)
committerTimo Sirainen <tss@iki.fi>
Mon, 31 May 2010 18:09:41 +0000 (19:09 +0100)
--HG--
branch : HEAD

src/lib-index/mail-transaction-log.c

index f3a4f3d0d8850755dc8b39c0d90acbad8f5b049c..a878a4f5d6191bf80c3a49d6f01dd28dd8910baa 100644 (file)
@@ -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. */