mirror of
https://github.com/asterisk/asterisk.git
synced 2025-10-27 06:31:54 +00:00
Merge "Astobj2: Fix initialization order of refdebug and AO2_DEBUG." into 13
This commit is contained in:
@@ -4353,7 +4353,10 @@ int main(int argc, char *argv[])
|
|||||||
register_config_cli();
|
register_config_cli();
|
||||||
read_config_maps();
|
read_config_maps();
|
||||||
|
|
||||||
astobj2_init();
|
if (astobj2_init()) {
|
||||||
|
printf("Failed: astobj2_init\n%s", term_quit());
|
||||||
|
exit(1);
|
||||||
|
}
|
||||||
|
|
||||||
if (ast_opt_console) {
|
if (ast_opt_console) {
|
||||||
if (el_hist == NULL || el == NULL)
|
if (el_hist == NULL || el == NULL)
|
||||||
|
|||||||
@@ -899,13 +899,7 @@ int astobj2_init(void)
|
|||||||
{
|
{
|
||||||
#ifdef REF_DEBUG
|
#ifdef REF_DEBUG
|
||||||
char ref_filename[1024];
|
char ref_filename[1024];
|
||||||
#endif
|
|
||||||
|
|
||||||
if (container_init() != 0) {
|
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
|
|
||||||
#ifdef REF_DEBUG
|
|
||||||
snprintf(ref_filename, sizeof(ref_filename), "%s/refs", ast_config_AST_LOG_DIR);
|
snprintf(ref_filename, sizeof(ref_filename), "%s/refs", ast_config_AST_LOG_DIR);
|
||||||
ref_log = fopen(ref_filename, "w");
|
ref_log = fopen(ref_filename, "w");
|
||||||
if (!ref_log) {
|
if (!ref_log) {
|
||||||
@@ -913,6 +907,11 @@ int astobj2_init(void)
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
if (container_init() != 0) {
|
||||||
|
fclose(ref_log);
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
#if defined(AO2_DEBUG)
|
#if defined(AO2_DEBUG)
|
||||||
ast_cli_register_multiple(cli_astobj2, ARRAY_LEN(cli_astobj2));
|
ast_cli_register_multiple(cli_astobj2, ARRAY_LEN(cli_astobj2));
|
||||||
#endif /* defined(AO2_DEBUG) */
|
#endif /* defined(AO2_DEBUG) */
|
||||||
|
|||||||
Reference in New Issue
Block a user