changeset 8502:570927dfc769 HEAD

mbox: If mailbox is deleted under us, try to avoid logging errors.
author Timo Sirainen <tss@iki.fi>
date Sun, 30 Nov 2008 04:03:20 +0200
parents 3fe1fb4e4f11
children 16ca1b36e6c3
files src/lib-storage/index/mbox/mbox-lock.c src/lib-storage/index/mbox/mbox-sync.c
diffstat 2 files changed, 12 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/src/lib-storage/index/mbox/mbox-lock.c	Sun Nov 30 02:45:12 2008 +0200
+++ b/src/lib-storage/index/mbox/mbox-lock.c	Sun Nov 30 04:03:20 2008 +0200
@@ -184,7 +184,10 @@
 		   deleted and the flushing might cause errors (e.g. EBUSY for
 		   trying to flush a /var/mail mountpoint) */
 		if (nfs_safe_stat(mbox->path, &st) < 0) {
-			mbox_set_syscall_error(mbox, "stat()");
+			if (errno == ENOENT)
+				mailbox_set_deleted(&mbox->ibox.box);
+			else
+				mbox_set_syscall_error(mbox, "stat()");
 			return -1;
 		}
 
--- a/src/lib-storage/index/mbox/mbox-sync.c	Sun Nov 30 02:45:12 2008 +0200
+++ b/src/lib-storage/index/mbox/mbox-sync.c	Sun Nov 30 04:03:20 2008 +0200
@@ -1585,11 +1585,19 @@
 		/* read-only stream */
 		st = i_stream_stat(mbox->mbox_file_stream, FALSE);
 		if (st == NULL) {
+			if (errno == ENOENT) {
+				mailbox_set_deleted(&mbox->ibox.box);
+				return 0;
+			}
 			mbox_set_syscall_error(mbox, "i_stream_stat()");
 			return -1;
 		}
 	} else {
 		if (stat(mbox->path, &statbuf) < 0) {
+			if (errno == ENOENT) {
+				mailbox_set_deleted(&mbox->ibox.box);
+				return 0;
+			}
 			mbox_set_syscall_error(mbox, "stat()");
 			return -1;
 		}