libubus: reset ctx->sock.error when doing ubus reconnect

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@gmail.com>
This commit is contained in:
Hans Dedecker 2017-02-18 13:41:52 +01:00 committed by Felix Fietkau
parent 6eb3c9647e
commit dfe338350e

View file

@ -375,6 +375,7 @@ int ubus_reconnect(struct ubus_context *ctx, const char *path)
} }
ctx->sock.eof = false; ctx->sock.eof = false;
ctx->sock.error = false;
ctx->sock.fd = usock(USOCK_UNIX, path, NULL); ctx->sock.fd = usock(USOCK_UNIX, path, NULL);
if (ctx->sock.fd < 0) if (ctx->sock.fd < 0)
return UBUS_STATUS_CONNECTION_FAILED; return UBUS_STATUS_CONNECTION_FAILED;