Default to listening for events forever unless -t is explicitly
specified on the command line
Signed-off-by: Felix Fietkau <nbd@nbd.name>
#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;
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();
}
ubus_socket = optarg;
break;
case 't':
+ listen_timeout = atoi(optarg);
timeout = atoi(optarg);
break;
case 'S':