Mod aaa-12 增加ZTP配置文件修改监视开关

RCA:
SOL:
修改人:huangxin
检视人:huangxin
This commit is contained in:
huangxin 2019-11-21 11:19:07 +08:00
parent 85f5bbe0a3
commit 02d7a5d3a1
3 changed files with 10 additions and 6 deletions

View File

@ -241,6 +241,7 @@ int load_ztp_config(const char *pPath)
return ERR_OK; return ERR_OK;
} }
#ifdef MONITOR_ZTP_CFG_FILE
static void *__cfg_file_monitor(void *p) static void *__cfg_file_monitor(void *p)
{ {
int wd; int wd;
@ -308,6 +309,7 @@ static void *__cfg_file_monitor(void *p)
return NULL; return NULL;
} }
#endif
int init_configure(const char *pPath) int init_configure(const char *pPath)
{ {
@ -330,7 +332,9 @@ int init_configure(const char *pPath)
load_ztp_config(g_ztpFilePath); load_ztp_config(g_ztpFilePath);
#ifdef MONITOR_ZTP_CFG_FILE
pthread_create(&g_monThreadId, NULL, __cfg_file_monitor, NULL); pthread_create(&g_monThreadId, NULL, __cfg_file_monitor, NULL);
#endif
return ERR_OK; return ERR_OK;
} }

View File

@ -135,7 +135,7 @@ static void __logColorOutput(const char* pColFmt, UT_string* pLog)
static void* __logOutputThread(void *p) static void* __logOutputThread(void *p)
{ {
(void)p; UNUSED(p);
while(g_bEnableLog) while(g_bEnableLog)
{ {
int isWriteLog = FALSE; int isWriteLog = FALSE;

View File

@ -32,8 +32,6 @@ int main(int argc, char** argv)
IHW_InitLOG("ZTP", NULL, TRUE); IHW_InitLOG("ZTP", NULL, TRUE);
APP_BUILD_INFO("ZTP", ZTP_VERSION); APP_BUILD_INFO("ZTP", ZTP_VERSION);
LOG_EX(LOG_Debug, "Hello ZTP V2\n");
init_configure(DEVICE_ZTP_PATH); init_configure(DEVICE_ZTP_PATH);
memset(&ztpReq, 0, sizeof(AUTH_ZTH_REQ)); memset(&ztpReq, 0, sizeof(AUTH_ZTH_REQ));
@ -53,9 +51,11 @@ int main(int argc, char** argv)
load_dev_config(ZTP_ESN); load_dev_config(ZTP_ESN);
// while(ret == ERR_OK){ #ifdef MONITOR_ZTP_CFG_FILE
// usleep(1000); while(ret == ERR_OK){
// } usleep(1000);
}
#endif
IHW_WaitFinishLogout(); IHW_WaitFinishLogout();