[asterisk-commits] jpeeler: trunk r121163 - /trunk/channels/chan_console.c

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Sat Jun 7 20:42:00 CDT 2008


Author: jpeeler
Date: Sat Jun  7 20:41:59 2008
New Revision: 121163

URL: http://svn.digium.com/view/asterisk?view=rev&rev=121163
Log:
This was accidentally reverted.
Fixes a bug where if a stream monitor thread was not created (caused from failure of opening or starting the stream) pthread_cancel was called with an invalid thread ID.


Modified:
    trunk/channels/chan_console.c

Modified: trunk/channels/chan_console.c
URL: http://svn.digium.com/view/asterisk/trunk/channels/chan_console.c?view=diff&rev=121163&r1=121162&r2=121163
==============================================================================
--- trunk/channels/chan_console.c (original)
+++ trunk/channels/chan_console.c Sat Jun  7 20:41:59 2008
@@ -393,7 +393,7 @@
 
 static int stop_stream(struct console_pvt *pvt)
 {
-	if (!pvt->streamstate)
+	if (!pvt->streamstate || pvt->thread == AST_PTHREADT_NULL)
 		return 0;
 
 	pthread_cancel(pvt->thread);




More information about the asterisk-commits mailing list