Mercurial > dovecot > original-hg > dovecot-2.2
changeset 16775:0eee8caeaa53
istream-chain/concat/seekable: When child stream fails, copy its error to ourself.
author | Timo Sirainen <tss@iki.fi> |
---|---|
date | Fri, 20 Sep 2013 00:20:19 +0300 |
parents | 28df180ec3ab |
children | c140de1b506b |
files | src/lib/istream-chain.c src/lib/istream-concat.c src/lib/istream-seekable.c |
diffstat | 3 files changed, 12 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- a/src/lib/istream-chain.c Fri Sep 20 00:14:11 2013 +0300 +++ b/src/lib/istream-chain.c Fri Sep 20 00:20:19 2013 +0300 @@ -203,6 +203,10 @@ if (ret == -1) { if (link->stream->stream_errno != 0) { + io_stream_set_error(&stream->iostream, + "read(%s) failed: %s", + i_stream_get_name(link->stream), + i_stream_get_error(link->stream)); stream->istream.stream_errno = link->stream->stream_errno; return -1;
--- a/src/lib/istream-concat.c Fri Sep 20 00:14:11 2013 +0300 +++ b/src/lib/istream-concat.c Fri Sep 20 00:20:19 2013 +0300 @@ -133,6 +133,10 @@ return ret; if (ret == -1 && cstream->cur_input->stream_errno != 0) { + io_stream_set_error(&cstream->istream.iostream, + "read(%s) failed: %s", + i_stream_get_name(cstream->cur_input), + i_stream_get_error(cstream->cur_input)); stream->istream.stream_errno = cstream->cur_input->stream_errno; return -1;
--- a/src/lib/istream-seekable.c Fri Sep 20 00:14:11 2013 +0300 +++ b/src/lib/istream-seekable.c Fri Sep 20 00:20:19 2013 +0300 @@ -139,6 +139,10 @@ while ((ret = i_stream_read(sstream->cur_input)) == -1) { if (sstream->cur_input->stream_errno != 0) { + io_stream_set_error(&sstream->istream.iostream, + "read(%s) failed: %s", + i_stream_get_name(sstream->cur_input), + i_stream_get_error(sstream->cur_input)); sstream->istream.istream.stream_errno = sstream->cur_input->stream_errno; return -1;