|
|
@ -592,6 +592,7 @@ static void *listener(void *unused)
|
|
|
|
fds[0].fd = ast_socket;
|
|
|
|
fds[0].fd = ast_socket;
|
|
|
|
fds[0].events= POLLIN;
|
|
|
|
fds[0].events= POLLIN;
|
|
|
|
s = poll(fds, 1, -1);
|
|
|
|
s = poll(fds, 1, -1);
|
|
|
|
|
|
|
|
pthread_testcancel();
|
|
|
|
if (s < 0) {
|
|
|
|
if (s < 0) {
|
|
|
|
if (errno != EINTR)
|
|
|
|
if (errno != EINTR)
|
|
|
|
ast_log(LOG_WARNING, "poll returned error: %s\n", strerror(errno));
|
|
|
|
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);
|
|
|
|
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");
|
|
|
|
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) {
|
|
|
|
if (ast_socket > -1) {
|
|
|
|
|
|
|
|
pthread_cancel(lthread);
|
|
|
|
close(ast_socket);
|
|
|
|
close(ast_socket);
|
|
|
|
ast_socket = -1;
|
|
|
|
ast_socket = -1;
|
|
|
|
|
|
|
|
unlink(ast_config_AST_SOCKET);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (ast_consock > -1)
|
|
|
|
if (ast_consock > -1)
|
|
|
|
close(ast_consock);
|
|
|
|
close(ast_consock);
|
|
|
|
if (ast_socket > -1)
|
|
|
|
|
|
|
|
unlink((char *)ast_config_AST_SOCKET);
|
|
|
|
|
|
|
|
if (!option_remote) unlink((char *)ast_config_AST_PID);
|
|
|
|
if (!option_remote) unlink((char *)ast_config_AST_PID);
|
|
|
|
printf(term_quit());
|
|
|
|
printf(term_quit());
|
|
|
|
if (restart) {
|
|
|
|
if (restart) {
|
|
|
|