changeset 12385:455bea720c13

istream-attachment: Error handling improvements.
author Timo Sirainen <tss@iki.fi>
date Thu, 04 Nov 2010 16:25:39 +0000
parents 71e13b4a44d4
children 8fed40bfaaba
files src/lib-storage/index/istream-attachment.c
diffstat 1 files changed, 6 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/src/lib-storage/index/istream-attachment.c	Thu Nov 04 16:25:18 2010 +0000
+++ b/src/lib-storage/index/istream-attachment.c	Thu Nov 04 16:25:39 2010 +0000
@@ -53,10 +53,14 @@
 		stream->istream.eof = TRUE;
 	} else if (!stream->istream.eof) {
 		/* still more to read */
+	} else if (stream->istream.stream_errno == ENOENT) {
+		/* lost the file */
 	} else {
 		i_error("Attachment file %s smaller than expected "
-			"(%"PRIuUOFF_T")", i_stream_get_name(stream->parent),
-			astream->size);
+			"(%"PRIuUOFF_T" < %"PRIuUOFF_T")",
+			i_stream_get_name(stream->parent),
+			stream->istream.v_offset, astream->size);
+		stream->istream.stream_errno = EIO;
 	}
 
 	ret = pos > stream->pos ? (ssize_t)(pos - stream->pos) :