aboutsummaryrefslogtreecommitdiffstats
path: root/asterisk.c
diff options
context:
space:
mode:
authorroot <root@f38db490-d61c-443f-a65b-d21fe96a405b>2006-07-03 06:03:44 +0000
committerroot <root@f38db490-d61c-443f-a65b-d21fe96a405b>2006-07-03 06:03:44 +0000
commite3a0bbf2d06a776f7f000521bab473101ab9642b (patch)
tree25a5a7b99a9ac2fc1b0319ebf9ce68a28ba42c61 /asterisk.c
parentabb076704d68201d3e12dae3c1c85bf676b47b82 (diff)
automerge commit
git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.2-netsec@36776 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'asterisk.c')
-rw-r--r--asterisk.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/asterisk.c b/asterisk.c
index b10dcba10..abb0a4392 100644
--- a/asterisk.c
+++ b/asterisk.c
@@ -592,6 +592,7 @@ static void *listener(void *unused)
fds[0].fd = ast_socket;
fds[0].events= POLLIN;
s = poll(fds, 1, -1);
+ pthread_testcancel();
if (s < 0) {
if (errno != EINTR)
ast_log(LOG_WARNING, "poll returned error: %s\n", strerror(errno));
@@ -905,13 +906,13 @@ static void quit_handler(int num, int nice, int safeshutdown, int restart)
ast_log(LOG_DEBUG, "Asterisk ending (%d).\n", num);
manager_event(EVENT_FLAG_SYSTEM, "Shutdown", "Shutdown: %s\r\nRestart: %s\r\n", ast_active_channels() ? "Uncleanly" : "Cleanly", restart ? "True" : "False");
if (ast_socket > -1) {
+ pthread_cancel(lthread);
close(ast_socket);
ast_socket = -1;
+ unlink(ast_config_AST_SOCKET);
}
if (ast_consock > -1)
close(ast_consock);
- if (ast_socket > -1)
- unlink((char *)ast_config_AST_SOCKET);
if (!option_remote) unlink((char *)ast_config_AST_PID);
printf(term_quit());
if (restart) {