Browse Source

lib/kmi: safety re-entrant call of init_mi_child()

- otherwise can get to a loop of trying, reported by Juha Heinanen
Daniel-Constantin Mierla 14 years ago
parent
commit
0e5fc52895
1 changed files with 1 additions and 1 deletions
  1. 1 1
      lib/kmi/mi.c

+ 1 - 1
lib/kmi/mi.c

@@ -106,6 +106,7 @@ int init_mi_child(void)
 
 	if(mi_commands_initialized)
 		return 0;
+	mi_commands_initialized = 1;
 	for ( i=0 ; i<mi_cmds_no ; i++ ) {
 		if ( mi_cmds[i].init_f && mi_cmds[i].init_f()!=0 ) {
 			LM_ERR("failed to init <%.*s>\n",
@@ -120,7 +121,6 @@ int init_mi_child(void)
 			return -1;
 		}
 	}
-	mi_commands_initialized = 1;
 	return 0;
 }