if (ret < 0)
ctx->sock.eof = true;
+ if (fd >= 0)
+ close(fd);
+
return ret;
}
ctx->connection_lost(ctx);
}
+void __hidden ubus_poll_data(struct ubus_context *ctx, int timeout)
+{
+ struct pollfd pfd = {
+ .fd = ctx->sock.fd,
+ .events = POLLIN | POLLERR,
+ };
+
+ poll(&pfd, 1, timeout);
+ ubus_handle_data(&ctx->sock, ULOOP_READ);
+}
+
static void
ubus_refresh_state(struct ubus_context *ctx)
{