libubus: fix error handling during close after partially receiving a message

Signed-off-by: Felix Fietkau <nbd@openwrt.org>
This commit is contained in:
Felix Fietkau 2015-12-09 18:26:43 +01:00
parent 83461b9791
commit 04e644bcce

View file

@ -293,7 +293,8 @@ static bool get_next_msg(struct ubus_context *ctx, int *recv_fd)
iov.iov_base = (char *)ctx->msgbuf.data + sizeof(hdrbuf.data);
iov.iov_len = blob_len(ctx->msgbuf.data);
if (iov.iov_len > 0 && !recv_retry(ctx->sock.fd, &iov, true, NULL))
if (iov.iov_len > 0 &&
recv_retry(ctx->sock.fd, &iov, true, NULL) <= 0)
return false;
return true;