[LEDE-DEV] [PATCH ubus 1/2] libubus: reset ctx->sock.error when doing ubus reconnect
Hans Dedecker
dedeckeh at gmail.com
Sat Feb 18 04:41:52 PST 2017
When ubus connect fails ctx->sock.eof will be set but ctx->sock.error
can be set as well. Reset ctx->sock.error as well when doing ubus
reconnect
Signed-off-by: Hans Dedecker <dedeckeh at gmail.com>
---
libubus-io.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/libubus-io.c b/libubus-io.c
index 7047ac5..daa7106 100644
--- a/libubus-io.c
+++ b/libubus-io.c
@@ -375,6 +375,7 @@ int ubus_reconnect(struct ubus_context *ctx, const char *path)
}
ctx->sock.eof = false;
+ ctx->sock.error = false;
ctx->sock.fd = usock(USOCK_UNIX, path, NULL);
if (ctx->sock.fd < 0)
return UBUS_STATUS_CONNECTION_FAILED;
--
2.11.0
More information about the Lede-dev
mailing list