diff options
author | russell <russell@f38db490-d61c-443f-a65b-d21fe96a405b> | 2006-07-03 05:14:06 +0000 |
---|---|---|
committer | russell <russell@f38db490-d61c-443f-a65b-d21fe96a405b> | 2006-07-03 05:14:06 +0000 |
commit | 36a08738c86597921096d6cc3a46ff81fc46105a (patch) | |
tree | 116a6a2be5aadd957805107c245414f863f27e17 /asterisk.c | |
parent | 4c50c16addfc846eefccf8d517e696a23e869bd1 (diff) |
Blocked revisions 36751 via svnmerge
........
r36751 | russell | 2006-07-03 01:12:03 -0400 (Mon, 03 Jul 2006) | 3 lines
fix a race condition that caused asterisk to log a *ton* of warnings on mac
osx about poll returning an error because the polled file descriptor was bad.
........
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@36752 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'asterisk.c')
-rw-r--r-- | asterisk.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/asterisk.c b/asterisk.c index 1b899eac4..118d4fe03 100644 --- a/asterisk.c +++ b/asterisk.c @@ -839,6 +839,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)); @@ -1152,10 +1153,10 @@ 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); - pthread_cancel(lthread); } if (ast_consock > -1) close(ast_consock); |