From e5e1659ec22447d8869922426e23f60f0816f885 Mon Sep 17 00:00:00 2001 From: Timo Sirainen Date: Fri, 23 Dec 2016 12:59:13 -0500 Subject: [PATCH] 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. --- src/lib-mail/istream-attachment-extractor.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/lib-mail/istream-attachment-extractor.c b/src/lib-mail/istream-attachment-extractor.c index bdbd234293..eed2a00ea5 100644 --- a/src/lib-mail/istream-attachment-extractor.c +++ b/src/lib-mail/istream-attachment-extractor.c @@ -613,7 +613,7 @@ static int astream_read_next(struct attachment_istream *astream, bool *retry_r) 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 @@ static int astream_read_next(struct attachment_istream *astream, bool *retry_r) /* 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; } } -- 2.47.3