asterisk/funcs
Matthew Jordan a0c363e227 Refactor ast_timer_ack to return an error and handle the error in timer users
Currently, if an acknowledgement of a timer fails Asterisk will not realize
that a serious error occurred and will continue attempting to use the timer's
file descriptor.  This can lead to situations where errors stream to the
CLI/log file.  This consumes significant resources, masks the actual problem
that occurred (whatever caused the timer to fail in the first place), and
can leave channels in odd states.

This patch propagates the errors in the timing resource modules up through
the timer core, and makes users of these timers handle acknowledgement
failures.  It also adds some defensive coding around the use of timers
to prevent using bad file descriptors in off nominal code paths.

Note that the patch created by the issue reporter was modified slightly for
this commit and backported to 1.8, as it was originally written for
Asterisk 10.

Review: https://reviewboard.asterisk.org/r/2178/

(issue ASTERISK-20032)
Reported by: Jeremiah Gowdy
patches:
  jgowdy-timerfd-6-22-2012.diff uploaded by Jeremiah Gowdy (license 6358)
........

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

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

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@375896 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-11-05 23:10:14 +00:00
..
Makefile Title update 2012-10-14 21:56:13 +00:00
func_aes.c Fix many issues from the NULL_RETURNS Coverity report 2012-05-04 22:17:38 +00:00
func_audiohookinherit.c func_audiohookinherit: Document some missed sources. 2012-09-24 21:19:49 +00:00
func_base64.c Merged revisions 328247 via svnmerge from 2011-07-14 20:28:54 +00:00
func_blacklist.c Opaquify ast_channel structs and lists 2012-02-29 16:52:47 +00:00
func_callcompletion.c Merged revisions 328247 via svnmerge from 2011-07-14 20:28:54 +00:00
func_callerid.c Allow for redirecting reasons to be set to arbitrary strings. 2012-09-25 19:29:14 +00:00
func_cdr.c Coverity Report: Fix issues for error type UNINIT in Core supported modules 2012-05-10 15:57:26 +00:00
func_channel.c Named call pickup groups. Fixes, missing functionality, and improvements. 2012-09-20 17:22:41 +00:00
func_config.c Merged revisions 328247 via svnmerge from 2011-07-14 20:28:54 +00:00
func_curl.c Ensure that all ast_datastore_info structures are 'const'. 2012-07-18 17:18:20 +00:00
func_cut.c Clean up and ensure proper usage of alloca() 2012-07-31 20:21:43 +00:00
func_db.c Merged revisions 328247 via svnmerge from 2011-07-14 20:28:54 +00:00
func_devstate.c Coverity Report: Fix issues for error type CHECKED_RETURN for core 2012-05-10 18:35:14 +00:00
func_dialgroup.c Fix a variety of memory leaks 2012-05-18 14:43:44 +00:00
func_dialplan.c Enable macros in 1.8 to find the next highest "h" extension in a context, like in 1.4. 2012-03-13 08:06:20 +00:00
func_enum.c Allow ENUM query functions to report lookup errors 2011-08-09 17:08:33 +00:00
func_env.c Fix places where a negative return from ftello could be used as invalid input 2012-04-17 20:59:25 +00:00
func_extstate.c Merged revisions 328247 via svnmerge from 2011-07-14 20:28:54 +00:00
func_frame_trace.c Commit framework for HANGUPCAUSE (replacement for SIP_CAUSE) 2012-05-14 19:44:27 +00:00
func_global.c Clean up and ensure proper usage of alloca() 2012-07-31 20:21:43 +00:00
func_groupcount.c Avoid cppcheck warnings; removing unused vars and a bit of cleanup. 2012-04-17 18:57:40 +00:00
func_hangupcause.c Make the name of the "HangupCauseClear" application consistent 2012-08-18 01:34:50 +00:00
func_iconv.c Merged revisions 328247 via svnmerge from 2011-07-14 20:28:54 +00:00
func_jitterbuffer.c Refactor ast_timer_ack to return an error and handle the error in timer users 2012-11-05 23:10:14 +00:00
func_lock.c Ensure that all ast_datastore_info structures are 'const'. 2012-07-18 17:18:20 +00:00
func_logic.c Clean up and ensure proper usage of alloca() 2012-07-31 20:21:43 +00:00
func_math.c Remove annoying unconditional debug message from INC/DEC functions. 2012-09-07 22:10:33 +00:00
func_md5.c Merged revisions 328247 via svnmerge from 2011-07-14 20:28:54 +00:00
func_module.c Merged revisions 328247 via svnmerge from 2011-07-14 20:28:54 +00:00
func_odbc.c Fix misuses of asprintf throughout the code. 2012-08-21 21:01:11 +00:00
func_pitchshift.c Merged revisions 328247 via svnmerge from 2011-07-14 20:28:54 +00:00
func_presencestate.c "He who go through turnstile sideways is going to Bangkok" 2012-09-25 14:13:08 +00:00
func_rand.c Merged revisions 328247 via svnmerge from 2011-07-14 20:28:54 +00:00
func_realtime.c Allow the REALTIME() function to report errors back to the caller. 2012-07-11 17:16:50 +00:00
func_sha1.c Merged revisions 328247 via svnmerge from 2011-07-14 20:28:54 +00:00
func_shell.c Improve documentation for the SHELL() dialplan function. 2012-07-23 21:10:27 +00:00
func_speex.c Doxygen Updates - janitor work 2012-09-21 17:14:59 +00:00
func_sprintf.c Merged revisions 328247 via svnmerge from 2011-07-14 20:28:54 +00:00
func_srv.c Merged revisions 328247 via svnmerge from 2011-07-14 20:28:54 +00:00
func_strings.c Make evaluation of channel variables consistently case-sensitive. 2012-10-29 21:27:09 +00:00
func_sysinfo.c Multiple revisions 361403,361412 2012-04-06 16:33:24 +00:00
func_timeout.c Opaquify ast_channel structs and lists 2012-02-29 16:52:47 +00:00
func_uri.c Merged revisions 328247 via svnmerge from 2011-07-14 20:28:54 +00:00
func_version.c Fix documentation for ${VERSION(ASTERISK_VERSION_NUM)}. 2012-04-19 22:01:20 +00:00
func_vmcount.c Merged revisions 328247 via svnmerge from 2011-07-14 20:28:54 +00:00
func_volume.c Fix a deadlock that occurs when func_volume is used on a local channel. 2012-06-13 21:17:13 +00:00