From 04e644bcce3207df6992cbc36598afc4abf871b1 Mon Sep 17 00:00:00 2001 From: Felix Fietkau Date: Wed, 9 Dec 2015 18:26:43 +0100 Subject: [PATCH] libubus: fix error handling during close after partially receiving a message Signed-off-by: Felix Fietkau --- libubus-io.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/libubus-io.c b/libubus-io.c index e6d4236..b9b3128 100644 --- a/libubus-io.c +++ b/libubus-io.c @@ -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; -- 2.25.1