changeset 21689:ac0221985e8d

lib-mail: istream-attachment-extractor - use EIO for internal errors These happen only if the attachment writing failed for some reason. The input stream itself can't have any errors, so EINVAL isn't proper.
author Timo Sirainen <timo.sirainen@dovecot.fi>
date Fri, 23 Dec 2016 12:59:13 -0500
parents d1788e9bd7ea
children 9eec2e30f6ea
files src/lib-mail/istream-attachment-extractor.c
diffstat 1 files changed, 2 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/src/lib-mail/istream-attachment-extractor.c	Fri Dec 23 12:56:24 2016 -0500
+++ b/src/lib-mail/istream-attachment-extractor.c	Fri Dec 23 12:59:13 2016 -0500
@@ -613,7 +613,7 @@
 
 		if (ret < 0) {
 			io_stream_set_error(&stream->iostream, "%s", error);
-			stream->istream.stream_errno = EINVAL;
+			stream->istream.stream_errno = EIO;
 		}
 		astream->cur_part = NULL;
 		return -1;
@@ -628,7 +628,7 @@
 		/* end of a MIME part */
 		if (astream_end_of_part(astream, &error) < 0) {
 			io_stream_set_error(&stream->iostream, "%s", error);
-			stream->istream.stream_errno = EINVAL;
+			stream->istream.stream_errno = EIO;
 			return -1;
 		}
 	}