dovecot-2.2: dsync: Minor (probably unnecessary) fix for i_strea...

dovecot at dovecot.org dovecot at dovecot.org
Sat Dec 15 14:28:01 EET 2012


details:   http://hg.dovecot.org/dovecot-2.2/rev/fc6873897e8b
changeset: 15483:fc6873897e8b
user:      Timo Sirainen <tss at iki.fi>
date:      Sat Dec 15 14:27:56 2012 +0200
description:
dsync: Minor (probably unnecessary) fix for i_stream_read() API usage.
Avoid the first read returning -2.

diffstat:

 src/doveadm/dsync/dsync-ibc-stream.c |  4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diffs (16 lines):

diff -r 6f940b2bfbe6 -r fc6873897e8b src/doveadm/dsync/dsync-ibc-stream.c
--- a/src/doveadm/dsync/dsync-ibc-stream.c	Sat Dec 15 14:24:41 2012 +0200
+++ b/src/doveadm/dsync/dsync-ibc-stream.c	Sat Dec 15 14:27:56 2012 +0200
@@ -143,10 +143,10 @@
 
 static int dsync_ibc_stream_read_mail_stream(struct dsync_ibc_stream *ibc)
 {
-	while (i_stream_read(ibc->mail_input) > 0) {
+	do {
 		i_stream_skip(ibc->mail_input,
 			      i_stream_get_data_size(ibc->mail_input));
-	}
+	} while (i_stream_read(ibc->mail_input) > 0);
 	if (ibc->mail_input->eof) {
 		if (ibc->mail_input->stream_errno != 0) {
 			errno = ibc->mail_input->stream_errno;


More information about the dovecot-cvs mailing list