]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
mbox: If mailbox is deleted under us, try to avoid logging errors.
authorTimo Sirainen <tss@iki.fi>
Sun, 30 Nov 2008 02:03:20 +0000 (04:03 +0200)
committerTimo Sirainen <tss@iki.fi>
Sun, 30 Nov 2008 02:03:20 +0000 (04:03 +0200)
--HG--
branch : HEAD

src/lib-storage/index/mbox/mbox-lock.c
src/lib-storage/index/mbox/mbox-sync.c

index 9beddb127901412ea0bd42f158750a8a834e67f6..ad7ad1c8dfa624b3f6567928682f5a43a1d9f725 100644 (file)
@@ -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;
                }
 
index 55feed8535c3c8896b82a1bae6c0f1f3227b2395..cb5146803caf2432dfdbb9fccd67ab4a55315f84 100644 (file)
@@ -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;
                }