diff options
Diffstat (limited to 'main')
-rw-r--r-- | main/app.c | 4 | ||||
-rw-r--r-- | main/asterisk.c | 6 | ||||
-rw-r--r-- | main/data.c | 3 |
3 files changed, 10 insertions, 3 deletions
diff --git a/main/app.c b/main/app.c index 69e312de9..6f70b2101 100644 --- a/main/app.c +++ b/main/app.c @@ -2786,7 +2786,9 @@ int ast_app_parse_timelen(const char *timestr, int *result, enum ast_timelen uni return -1; } - if ((res = sscanf(timestr, FMT, &amount, u)) == 0) { + res = sscanf(timestr, FMT, &amount, u); + + if (res == 0 || res == EOF) { #undef FMT return -1; } else if (res == 2) { diff --git a/main/asterisk.c b/main/asterisk.c index 95355e42f..2e5ffa729 100644 --- a/main/asterisk.c +++ b/main/asterisk.c @@ -1975,11 +1975,17 @@ static void really_quit(int num, shutdown_nice_t niceness, int restart) close(ast_socket); ast_socket = -1; unlink(ast_config_AST_SOCKET); + pthread_kill(lthread, SIGURG); + pthread_join(lthread, NULL); } if (ast_consock > -1) close(ast_consock); if (!ast_opt_remote) unlink(ast_config_AST_PID); + if (sig_alert_pipe[0]) + close(sig_alert_pipe[0]); + if (sig_alert_pipe[1]) + close(sig_alert_pipe[1]); printf("%s", term_quit()); if (restart) { int i; diff --git a/main/data.c b/main/data.c index 73a336613..af4abd902 100644 --- a/main/data.c +++ b/main/data.c @@ -3313,6 +3313,7 @@ static void data_shutdown(void) ao2_t_ref(root_data.container, -1, "Unref root_data.container in data_shutdown"); root_data.container = NULL; ast_rwlock_destroy(&root_data.lock); + AST_TEST_UNREGISTER(test_data_get); } int ast_data_init(void) @@ -3330,9 +3331,7 @@ int ast_data_init(void) res |= ast_manager_register_xml_core("DataGet", 0, manager_data_get); -#ifdef TEST_FRAMEWORK AST_TEST_REGISTER(test_data_get); -#endif ast_register_atexit(data_shutdown); |