[dovecot-cvs] dovecot/src/lib ostream.c,1.16.2.1,1.16.2.2

tss at dovecot.org tss at dovecot.org
Thu Feb 22 14:10:04 UTC 2007


Update of /var/lib/cvs/dovecot/src/lib
In directory talvi:/tmp/cvs-serv14416

Modified Files:
      Tag: branch_1_0
	ostream.c 
Log Message:
If o_stream_send_istream() fails, make sure errno is set to
outstream.stream_errno.



Index: ostream.c
===================================================================
RCS file: /var/lib/cvs/dovecot/src/lib/ostream.c,v
retrieving revision 1.16.2.1
retrieving revision 1.16.2.2
diff -u -d -r1.16.2.1 -r1.16.2.2
--- ostream.c	18 Nov 2006 23:31:14 -0000	1.16.2.1
+++ ostream.c	22 Feb 2007 14:10:02 -0000	1.16.2.2
@@ -137,11 +137,15 @@
 			    struct istream *instream)
 {
 	struct _ostream *_outstream = outstream->real_stream;
+	off_t ret;
 
 	if (outstream->closed || instream->closed)
 		return -1;
 
-	return _outstream->send_istream(_outstream, instream);
+	ret = _outstream->send_istream(_outstream, instream);
+	if (ret < 0)
+		errno = outstream->stream_errno;
+	return ret;
 }
 
 struct ostream *_o_stream_create(struct _ostream *_stream, pool_t pool)



More information about the dovecot-cvs mailing list