diff options
author | Felix Fietkau <nbd@nbd.name> | 2017-02-15 11:35:35 +0100 |
---|---|---|
committer | Felix Fietkau <nbd@nbd.name> | 2017-02-15 11:35:38 +0100 |
commit | 6eb3c9647e04d38f14e6c8d3e2d9b6922f2a43d1 (patch) | |
tree | 59160781607de9bb791b99e3a39bd05ffd4dcd42 | |
parent | 453b87f6315fe923b38eff0f4cead622f8f31b12 (diff) | |
download | ubus-6eb3c9647e04d38f14e6c8d3e2d9b6922f2a43d1.tar.gz |
cli: do not use default timeout for listen
Default to listening for events forever unless -t is explicitly
specified on the command line
Signed-off-by: Felix Fietkau <nbd@nbd.name>
-rw-r--r-- | cli.c | 5 |
1 files changed, 4 insertions, 1 deletions
@@ -17,6 +17,7 @@ #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; @@ -171,7 +172,8 @@ static void do_listen(struct ubus_context *ctx, struct cli_listen_data *data) data->timeout.cb = 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(); } @@ -585,6 +587,7 @@ int main(int argc, char **argv) ubus_socket = optarg; break; case 't': + listen_timeout = atoi(optarg); timeout = atoi(optarg); break; case 'S': |