dovecot-2.2: dsync: Added assert

dovecot at dovecot.org dovecot at dovecot.org
Wed Apr 23 16:21:58 UTC 2014


details:   http://hg.dovecot.org/dovecot-2.2/rev/e20a6192ddcf
changeset: 17252:e20a6192ddcf
user:      Timo Sirainen <tss at iki.fi>
date:      Wed Apr 23 19:21:40 2014 +0300
description:
dsync: Added assert

diffstat:

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

diffs (28 lines):

diff -r 98d3020ea144 -r e20a6192ddcf src/doveadm/dsync/dsync-ibc-stream.c
--- a/src/doveadm/dsync/dsync-ibc-stream.c	Wed Apr 23 19:20:23 2014 +0300
+++ b/src/doveadm/dsync/dsync-ibc-stream.c	Wed Apr 23 19:21:40 2014 +0300
@@ -359,6 +359,7 @@
 {
 	string_t *error;
 	const char *line;
+	ssize_t ret;
 
 	line = i_stream_next_line(ibc->input);
 	if (line != NULL) {
@@ -366,7 +367,7 @@
 		return 1;
 	}
 	/* try reading some */
-	if (i_stream_read(ibc->input) == -1) {
+	if ((ret = i_stream_read(ibc->input)) == -1) {
 		if (ibc->stopped)
 			return -1;
 		error = t_str_new(128);
@@ -385,6 +386,7 @@
 		dsync_ibc_stream_stop(ibc);
 		return -1;
 	}
+	i_assert(ret >= 0);
 	*line_r = i_stream_next_line(ibc->input);
 	if (*line_r == NULL) {
 		ibc->has_pending_data = FALSE;


More information about the dovecot-cvs mailing list