[svn-commits] russell: trunk r193718 - /trunk/res/res_timing_timerfd.c

SVN commits to the Digium repositories svn-commits at lists.digium.com
Mon May 11 17:04:44 CDT 2009


Author: russell
Date: Mon May 11 17:04:40 2009
New Revision: 193718

URL: http://svn.asterisk.org/svn-view/asterisk?view=rev&rev=193718
Log:
Fix some timer state corruption.

In res_timer_timerfd, handle the case that set_rate gets called while a timer
is still in continuous mode.  In this case, we want to remember the configured
rate, but not actually set it until continuous mode has been disabled.

Thanks to dvossel for finding and helping to debug the problem.

(closes issue #15080)
Reported by: dvossel
Tested by: dvossel

Modified:
    trunk/res/res_timing_timerfd.c

Modified: trunk/res/res_timing_timerfd.c
URL: http://svn.asterisk.org/svn-view/asterisk/trunk/res/res_timing_timerfd.c?view=diff&rev=193718&r1=193717&r2=193718
==============================================================================
--- trunk/res/res_timing_timerfd.c (original)
+++ trunk/res/res_timing_timerfd.c Mon May 11 17:04:40 2009
@@ -134,7 +134,7 @@
 	struct timerfd_timer *our_timer, find_helper = {
 		.handle = handle,
 	};
-	int res;
+	int res = 0;
 
 	if (!(our_timer = ao2_find(timerfd_timers, &find_helper, OBJ_POINTER))) {
 		ast_log(LOG_ERROR, "Couldn't find timer with handle %d\n", handle);
@@ -146,7 +146,9 @@
 	our_timer->saved_timer.it_interval.tv_sec = our_timer->saved_timer.it_value.tv_sec;
 	our_timer->saved_timer.it_interval.tv_nsec = our_timer->saved_timer.it_value.tv_nsec;
 
-	res = timerfd_settime(handle, 0, &our_timer->saved_timer, NULL);
+	if (!our_timer->is_continuous) {
+		res = timerfd_settime(handle, 0, &our_timer->saved_timer, NULL);
+	}
 
 	ao2_ref(our_timer, -1);
 




More information about the svn-commits mailing list