diff options
Diffstat (limited to 'channels/chan_iax2.c')
-rw-r--r-- | channels/chan_iax2.c | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/channels/chan_iax2.c b/channels/chan_iax2.c index 602511424..272ad832b 100644 --- a/channels/chan_iax2.c +++ b/channels/chan_iax2.c @@ -9253,8 +9253,11 @@ static int timing_read(int *id, int fd, short events, void *cbdata) if (iaxtrunkdebug) ast_verbose("Beginning trunk processing. Trunk queue ceiling is %d bytes per host\n", trunkmaxsize); - if (timer) { - ast_timer_ack(timer, 1); + if (timer) { + if (ast_timer_ack(timer, 1) < 0) { + ast_log(LOG_ERROR, "Timer failed acknowledge\n"); + return 0; + } } /* For each peer that supports trunking... */ @@ -12372,7 +12375,9 @@ static void *network_thread(void *ignore) /* Wake up once a second just in case SIGURG was sent while * we weren't in poll(), to make sure we don't hang when trying * to unload. */ - ast_io_wait(io, 1000); + if (ast_io_wait(io, 1000) <= 0) { + break; + } } return NULL; @@ -14591,6 +14596,7 @@ static int __unload_module(void) ao2_ref(callno_pool_trunk, -1); if (timer) { ast_timer_close(timer); + timer = NULL; } transmit_processor = ast_taskprocessor_unreference(transmit_processor); ast_sched_context_destroy(sched); @@ -14976,6 +14982,7 @@ static int load_module(void) if (set_config(config, 0, 0) == -1) { if (timer) { ast_timer_close(timer); + timer = NULL; } return AST_MODULE_LOAD_DECLINE; } |