dovecot-2.1: sdbox: If copying with link() fails with ENOENT, fa...

dovecot at dovecot.org dovecot at dovecot.org
Wed Apr 4 05:35:12 EEST 2012


details:   http://hg.dovecot.org/dovecot-2.1/rev/cc734436c140
changeset: 14378:cc734436c140
user:      Timo Sirainen <tss at iki.fi>
date:      Wed Apr 04 05:15:49 2012 +0300
description:
sdbox: If copying with link() fails with ENOENT, fallback to trying regular copying.
This also fixes missing error reporting for that case.

diffstat:

 src/lib-storage/index/dbox-single/sdbox-copy.c |  9 ++++++---
 1 files changed, 6 insertions(+), 3 deletions(-)

diffs (19 lines):

diff -r 2bcab08dc994 -r cc734436c140 src/lib-storage/index/dbox-single/sdbox-copy.c
--- a/src/lib-storage/index/dbox-single/sdbox-copy.c	Wed Apr 04 04:33:41 2012 +0300
+++ b/src/lib-storage/index/dbox-single/sdbox-copy.c	Wed Apr 04 05:15:49 2012 +0300
@@ -104,9 +104,12 @@
 	if (ret < 0) {
 		if (ECANTLINK(errno))
 			ret = 0;
-		else if (errno == ENOENT)
-			mail_set_expunged(mail);
-		else {
+		else if (errno == ENOENT) {
+			/* try if the fallback copying code can still
+			   read the file (the mail could still have the
+			   stream open) */
+			ret = 0;
+		} else {
 			mail_storage_set_critical(
 				_ctx->transaction->box->storage,
 				"link(%s, %s) failed: %m",


More information about the dovecot-cvs mailing list