]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
ostream-metawrap: Copy parent ostream's errors.
authorTimo Sirainen <tss@iki.fi>
Sun, 7 Apr 2013 19:54:48 +0000 (22:54 +0300)
committerTimo Sirainen <tss@iki.fi>
Sun, 7 Apr 2013 19:54:48 +0000 (22:54 +0300)
src/lib-fs/ostream-metawrap.c

index 5e8faf1adb430955db00b980bddcf0296ac74421..7a4621ff43b4ca017cadae0855707b8f7d074457 100644 (file)
@@ -25,9 +25,12 @@ o_stream_metawrap_sendv(struct ostream_private *stream,
                        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 @@ o_stream_metawrap_send_istream(struct ostream_private *_outstream,
 {
        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 *