Skip to content

Commit

Permalink
core: more use of ksr_exit() macro to follow --atexit param
Browse files Browse the repository at this point in the history
  • Loading branch information
miconda committed Feb 9, 2021
1 parent d6504e2 commit 4f6243e
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 9 deletions.
13 changes: 7 additions & 6 deletions src/core/cfg.lex
Expand Up @@ -39,6 +39,7 @@
#include "select.h"
#include "cfg.tab.h"
#include "sr_compat.h"
#include "daemonize.h"
#include "ppcfg.h"

/* states */
Expand Down Expand Up @@ -1308,7 +1309,7 @@ IMPORTFILE "import_file"
LM_CRIT(
"error at %s line %d: '-' not allowed\n",
(finame)?finame:"cfg", line);
exit(-1);
ksr_exit(-1);
}
<DEFINE_ID>{ID} { count();
ksr_cfg_print_part(yytext);
Expand Down Expand Up @@ -1350,7 +1351,7 @@ IMPORTFILE "import_file"
LM_CRIT(
"error at %s line %d: '-' not allowed\n",
(finame)?finame:"cfg", line);
exit(-1);
ksr_exit(-1);
}
<IFDEF_ID>{ID} { count();
pp_ifdef_var(yyleng, yytext);
Expand Down Expand Up @@ -1404,7 +1405,7 @@ IMPORTFILE "import_file"
if(sr_push_yy_state(s_buf.s, 0)<0)
{
LOG(L_CRIT, "error at %s line %d\n", (finame)?finame:"cfg", line);
exit(-1);
ksr_exit(-1);
}
memset(&s_buf, 0, sizeof(s_buf));
ksr_cfg_print_initial_state();
Expand All @@ -1418,7 +1419,7 @@ IMPORTFILE "import_file"
if(sr_push_yy_state(s_buf.s, 1)<0)
{
LM_CRIT("error at %s line %d\n", (finame)?finame:"cfg", line);
exit(-1);
ksr_exit(-1);
}
memset(&s_buf, 0, sizeof(s_buf));
ksr_cfg_print_initial_state();
Expand All @@ -1439,7 +1440,7 @@ IMPORTFILE "import_file"
ksr_cfg_print_part(yytext);
if(pp_define_env(yytext, yyleng) < 0) {
LM_CRIT("error at %s line %d\n", (finame)?finame:"cfg", line);
exit(-1);
ksr_exit(-1);
}
state = INITIAL;
ksr_cfg_print_initial_state();
Expand Down Expand Up @@ -1610,7 +1611,7 @@ static char* addstr(struct str_buf* dst_b, char* src, int len)
return dst_b->s;
error:
PKG_MEM_CRITICAL;
exit(-1);
ksr_exit(-1);
}


Expand Down
3 changes: 2 additions & 1 deletion src/core/cfg.y
Expand Up @@ -69,6 +69,7 @@
#include "ppcfg.h"
#include "pvapi.h"
#include "config.h"
#include "daemonize.h"
#include "cfg_core.h"
#include "cfg/cfg.h"
#ifdef CORE_TLS
Expand Down Expand Up @@ -3521,7 +3522,7 @@ cmd:
if (mod_func_action != NULL) {
LM_ERR("function used inside params of another function: %s\n", $1);
yyerror("use of function execution inside params not allowed\n");
exit(-1);
ksr_exit(-1);
}
mod_func_action = mk_action(MODULE0_T, 2, MODEXP_ST, NULL, NUMBER_ST, 0);
} LPAREN func_params RPAREN {
Expand Down
3 changes: 2 additions & 1 deletion src/core/sr_module.c
Expand Up @@ -45,6 +45,7 @@
#include "fmsg.h"
#include "async_task.h"
#include "shm_init.h"
#include "daemonize.h"

#include <sys/stat.h>
#include <regex.h>
Expand Down Expand Up @@ -541,7 +542,7 @@ int load_module(char* mod_path)
}
/* version control */
if (!version_control(handle, path)) {
exit(-1);
ksr_exit(-1);
}
/* launch register */
mr = (mod_register_function)dlsym(handle, "mod_register");
Expand Down
3 changes: 2 additions & 1 deletion src/core/tcp_read.c
Expand Up @@ -52,6 +52,7 @@
#include "ut.h"
#include "trim.h"
#include "pt.h"
#include "daemonize.h"
#include "cfg/cfg_struct.h"
#ifdef CORE_TLS
#include "tls/tls_server.h"
Expand Down Expand Up @@ -2009,7 +2010,7 @@ void tcp_receive_loop(int unix_sock)
error:
destroy_io_wait(&io_w);
LM_CRIT("exiting...");
exit(-1);
ksr_exit(-1);
}


Expand Down

0 comments on commit 4f6243e

Please sign in to comment.