X-Git-Url: http://git.archive.openwrt.org/?p=project%2Fubus.git;a=blobdiff_plain;f=libubus-io.c;h=9a6c7cd77ec168be2b6779fc9fe05aea751c0fa2;hp=030d38255c4193ad39db31256f6771975c7bf417;hb=1d5ac421a5b3dca60562e876ba70d0c2fe46b3d2;hpb=4d7b2ab6390584839bbee0a42bf1556b25afb4f1 diff --git a/libubus-io.c b/libubus-io.c index 030d382..9a6c7cd 100644 --- a/libubus-io.c +++ b/libubus-io.c @@ -264,6 +264,17 @@ void __hidden ubus_handle_data(struct uloop_fd *u, unsigned int events) 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) {