[svn-commits] rmudgett: trunk r371892 - in /trunk: ./ main/channel.c

SVN commits to the Digium repositories svn-commits at lists.digium.com
Wed Aug 29 14:49:00 CDT 2012


Author: rmudgett
Date: Wed Aug 29 14:48:56 2012
New Revision: 371892

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=371892
Log:
Initialize file descriptors for dummy channels to -1.

Dummy channels usually aren't read from, but functions like SHELL and CURL
use autoservice on the channel.

(closes issue ASTERISK-20283)
Reported by: Gareth Palmer
Patches:
      svn-371580.patch (license #5169) patch uploaded by Gareth Palmer (modified)
........

Merged revisions 371888 from http://svn.asterisk.org/svn/asterisk/branches/1.8
........

Merged revisions 371890 from http://svn.asterisk.org/svn/asterisk/branches/10
........

Merged revisions 371891 from http://svn.asterisk.org/svn/asterisk/branches/11

Modified:
    trunk/   (props changed)
    trunk/main/channel.c

Propchange: trunk/
------------------------------------------------------------------------------
Binary property 'branch-11-merged' - no diff available.

Modified: trunk/main/channel.c
URL: http://svnview.digium.com/svn/asterisk/trunk/main/channel.c?view=diff&rev=371892&r1=371891&r2=371892
==============================================================================
--- trunk/main/channel.c (original)
+++ trunk/main/channel.c Wed Aug 29 14:48:56 2012
@@ -1207,6 +1207,18 @@
 
 	ast_pbx_hangup_handler_init(tmp);
 	AST_LIST_HEAD_INIT_NOLOCK(ast_channel_datastores(tmp));
+
+	/*
+	 * Init file descriptors to unopened state just in case
+	 * autoservice is called on the channel or something tries to
+	 * read a frame from it.
+	 */
+	ast_channel_timingfd_set(tmp, -1);
+	ast_channel_internal_alertpipe_clear(tmp);
+	ast_channel_internal_fd_clear_all(tmp);
+#ifdef HAVE_EPOLL
+	ast_channel_epfd(tmp) = -1;
+#endif
 
 	headp = ast_channel_varshead(tmp);
 	AST_LIST_HEAD_INIT_NOLOCK(headp);




More information about the svn-commits mailing list