#include "libubus.h"
static struct blob_buf b;
+static int listen_timeout;
static int timeout = 30;
static bool simple_output = false;
static int verbose = 0;
bool timed_out;
};
-static void listen_timeout(struct uloop_timeout *timeout)
+static void ubus_cli_listen_timeout(struct uloop_timeout *timeout)
{
struct cli_listen_data *data = container_of(timeout, struct cli_listen_data, timeout);
data->timed_out = true;
static void do_listen(struct ubus_context *ctx, struct cli_listen_data *data)
{
memset(data, 0, sizeof(*data));
- data->timeout.cb = listen_timeout;
+ data->timeout.cb = ubus_cli_listen_timeout;
uloop_init();
ubus_add_uloop(ctx);
- uloop_timeout_set(&data->timeout, timeout * 1000);
+ if (listen_timeout)
+ uloop_timeout_set(&data->timeout, listen_timeout * 1000);
uloop_run();
uloop_done();
}
ubus_socket = optarg;
break;
case 't':
+ listen_timeout = atoi(optarg);
timeout = atoi(optarg);
break;
case 'S':