From: Timo Sirainen Date: Sun, 30 Nov 2008 02:03:20 +0000 (+0200) Subject: mbox: If mailbox is deleted under us, try to avoid logging errors. X-Git-Tag: 1.2.alpha5~54 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=145ecefd208f5d7f6a52cb326a85f28d2154e217;p=thirdparty%2Fdovecot%2Fcore.git mbox: If mailbox is deleted under us, try to avoid logging errors. --HG-- branch : HEAD --- diff --git a/src/lib-storage/index/mbox/mbox-lock.c b/src/lib-storage/index/mbox/mbox-lock.c index 9beddb1279..ad7ad1c8df 100644 --- a/src/lib-storage/index/mbox/mbox-lock.c +++ b/src/lib-storage/index/mbox/mbox-lock.c @@ -184,7 +184,10 @@ static int mbox_file_open_latest(struct mbox_lock_context *ctx, int lock_type) 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; } diff --git a/src/lib-storage/index/mbox/mbox-sync.c b/src/lib-storage/index/mbox/mbox-sync.c index 55feed8535..cb5146803c 100644 --- a/src/lib-storage/index/mbox/mbox-sync.c +++ b/src/lib-storage/index/mbox/mbox-sync.c @@ -1585,11 +1585,19 @@ int mbox_sync_has_changed_full(struct mbox_mailbox *mbox, bool leave_dirty, /* 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; }