summaryrefslogtreecommitdiff
path: root/main
diff options
context:
space:
mode:
authorJonathan Rose <jrose@digium.com>2012-01-05 16:16:51 +0000
committerJonathan Rose <jrose@digium.com>2012-01-05 16:16:51 +0000
commitebf40f1129670e034f535777cac029fca74c7275 (patch)
tree15dd9d89c9cb01877131439a8e9b85e9ce64fbb0 /main
parentbaa7f14aabf2beb5cc3da52ac10c2127da271812 (diff)
Ensures Asterisk closes when receiving terminal signals in 'no fork' mode.
When catching a signal, in no fork mode the console thread is identical to the thread responsible for catching the signal and closing Asterisk, which requires it to first dispense with the console thread. Prior to this patch, if these threads were identical, upon receiving a killing signal, the thread will send an URG signal to itself, which we also catch and then promptly do nothing with. Obviously this isn't useful behavior. (closes issue ASTERISK-19127) Reported By: Bryon Clark Patches: quit_on_signals.patch uploaded by Bryon Clark (license 6157) ........ Merged revisions 349672 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 349673 from http://svn.asterisk.org/svn/asterisk/branches/10 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@349674 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'main')
-rw-r--r--main/asterisk.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/main/asterisk.c b/main/asterisk.c
index 48192758c..37bc92f5c 100644
--- a/main/asterisk.c
+++ b/main/asterisk.c
@@ -3128,7 +3128,7 @@ static void *monitor_sig_flags(void *unused)
}
if (sig_flags.need_quit) {
sig_flags.need_quit = 0;
- if (consolethread != AST_PTHREADT_NULL) {
+ if ((consolethread != AST_PTHREADT_NULL) && (consolethread != pthread_self())) {
sig_flags.need_quit_handler = 1;
pthread_kill(consolethread, SIGURG);
} else {