From cca7fb2ab1111caae0265dff1a4434851369face Mon Sep 17 00:00:00 2001 From: Yousong Zhou Date: Thu, 25 Jul 2013 20:38:08 +0800 Subject: [PATCH] Fix the condition for stopping the writev_retry. All iov's were sent only after the last were sent (iov_len == 0). We could have 'cur_len == 0' if the sent iov's were sent wholly but not all iov's were sent (how about all but the last). Signed-off-by: Yousong Zhou --- libubus-io.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libubus-io.c b/libubus-io.c index ca5fdaf..09f2dbf 100644 --- a/libubus-io.c +++ b/libubus-io.c @@ -77,7 +77,7 @@ static int writev_retry(int fd, struct iovec *iov, int iov_len) cur_len -= iov->iov_len; iov_len--; iov++; - if (!cur_len || !iov_len) + if (!iov_len) return len; } iov->iov_len -= cur_len; -- 2.11.0