From a7fed6b99e3ffa35e2bebef9772b01e5270cda13 Mon Sep 17 00:00:00 2001 From: HuangXin Date: Sun, 30 Sep 2018 16:23:37 +0800 Subject: [PATCH] Change application exit default value when heart lost --- app/libuvdbus/src/Framework/libuvEngine/libuv_dbus.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/app/libuvdbus/src/Framework/libuvEngine/libuv_dbus.c b/app/libuvdbus/src/Framework/libuvEngine/libuv_dbus.c index e73264b..cffb71a 100644 --- a/app/libuvdbus/src/Framework/libuvEngine/libuv_dbus.c +++ b/app/libuvdbus/src/Framework/libuvEngine/libuv_dbus.c @@ -79,7 +79,7 @@ static WIFI_STATUS g_WifiConnStatus = WIFI_CONNECTED; static PDBUS_MSG_PROC g_pMsgProcList = NULL; static uv_rwlock_t g_uvLoopRwLock; static PLOOP_TASK_ARRAY g_LoopArray = NULL; -static unsigned int g_EnHBLExit = TRUE; +static unsigned int g_EnHBLExit = FALSE; static uv_rwlock_t g_uvMsgProcRwLock; #if USED_SHM_TO_DBUS @@ -1449,10 +1449,13 @@ static void __dBusDeameonCb(MODULE_NAME modName, int status) "Daemon %s(%d) Msg: [%s]\n", ModuleNameToString(modName), modName, status == 0 ? "Connect" : "Disconnect"); + LOG_EX(LOG_Debug, "status = %d, module = %d, g_EnHBLExit = %d\n", + status, modName, g_EnHBLExit); + if(status != 0 && modName == MODULE_CONTROLLER && g_EnHBLExit) { - sleep(1); - //exit(0); + usleep(1000); + exit(0); } }