diff options
author | John Crispin <blogic@openwrt.org> | 2013-04-18 21:27:58 +0200 |
---|---|---|
committer | John Crispin <blogic@openwrt.org> | 2013-04-23 18:54:03 +0200 |
commit | 32f1c6e4679b6e0737616f3e58528531e826a3ce (patch) | |
tree | 48c57bd9cf880799db14a75a9f5e8d603287bc08 /ubus.c | |
parent | 9961e88dd853a30503298378679d2cedc497410e (diff) | |
download | unitd-32f1c6e4679b6e0737616f3e58528531e826a3ce.tar unitd-32f1c6e4679b6e0737616f3e58528531e826a3ce.zip |
fix behaviour during sysupgrade
Signed-off-by: John Crispin <blogic@openwrt.org>
Diffstat (limited to 'ubus.c')
-rw-r--r-- | ubus.c | 9 |
1 files changed, 9 insertions, 0 deletions
@@ -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; +} + |