diff --git a/modules/libcom/src/iocsh/atInit.c b/modules/libcom/src/iocsh/atInit.c index 9daf0cc2d..7338588ae 100644 --- a/modules/libcom/src/iocsh/atInit.c +++ b/modules/libcom/src/iocsh/atInit.c @@ -31,11 +31,11 @@ static int s_initendflag = 0; // Defines the end of the initialization static void atInitHook(initHookState state) { + struct cmditem *item = NULL; + if (state != initHookAfterIocRunning) return; - struct cmditem *item = NULL; - while ((item = (struct cmditem *)ellGet(&s_cmdlist))) { printf("%s\n", item->cmd);