dovecot-2.2: ostream-metawrap: Copy parent ostream's errors.
dovecot at dovecot.org
dovecot at dovecot.org
Sun Apr 7 22:54:54 EEST 2013
details: http://hg.dovecot.org/dovecot-2.2/rev/daf6803df4ac
changeset: 16234:daf6803df4ac
user: Timo Sirainen <tss at iki.fi>
date: Sun Apr 07 22:54:48 2013 +0300
description:
ostream-metawrap: Copy parent ostream's errors.
diffstat:
src/lib-fs/ostream-metawrap.c | 10 ++++++++--
1 files changed, 8 insertions(+), 2 deletions(-)
diffs (31 lines):
diff -r 32289a1d44fb -r daf6803df4ac src/lib-fs/ostream-metawrap.c
--- a/src/lib-fs/ostream-metawrap.c Sun Apr 07 20:32:37 2013 +0300
+++ b/src/lib-fs/ostream-metawrap.c Sun Apr 07 22:54:48 2013 +0300
@@ -25,9 +25,12 @@
const struct const_iovec *iov, unsigned int iov_count)
{
struct metawrap_ostream *mstream = (struct metawrap_ostream *)stream;
+ ssize_t ret;
o_stream_metawrap_call_callback(mstream);
- return o_stream_sendv(stream->parent, iov, iov_count);
+ if ((ret = o_stream_sendv(stream->parent, iov, iov_count)) < 0)
+ o_stream_copy_error_from_parent(stream);
+ return ret;
}
static off_t
@@ -36,9 +39,12 @@
{
struct metawrap_ostream *outstream =
(struct metawrap_ostream *)_outstream;
+ off_t ret;
o_stream_metawrap_call_callback(outstream);
- return o_stream_send_istream(_outstream->parent, instream);
+ if ((ret = o_stream_send_istream(_outstream->parent, instream)) < 0)
+ o_stream_copy_error_from_parent(stream);
+ return ret;
}
struct ostream *
More information about the dovecot-cvs
mailing list