summaryrefslogtreecommitdiffstats
path: root/ubus.c
diff options
context:
space:
mode:
Diffstat (limited to 'ubus.c')
-rw-r--r--ubus.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/ubus.c b/ubus.c
index e87543a..216cc16 100644
--- a/ubus.c
+++ b/ubus.c
@@ -23,6 +23,7 @@ char *ubus_socket = NULL;
static struct ubus_context *ctx;
static struct uloop_process ubus_proc;
static bool ubus_connected = false;
+static int reconnect = 1;
static void procd_ubus_connection_lost(struct ubus_context *old_ctx);
@@ -84,6 +85,9 @@ static void procd_ubus_try_connect(void)
static void procd_ubus_connection_lost(struct ubus_context *old_ctx)
{
+ if (!reconnect)
+ return;
+
procd_ubus_try_connect();
while (!ubus_connected) {
procd_restart_ubus();
@@ -101,3 +105,8 @@ void procd_connect_ubus(void)
procd_ubus_connection_lost(NULL);
}
+void procd_reconnect_ubus(int _reconnect)
+{
+ reconnect = _reconnect;
+}
+