[asterisk-commits] mmichelson: branch mmichelson/res_timing_timerfd r156086 - /team/mmichelson/r...

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Tue Nov 11 19:08:42 CST 2008


Author: mmichelson
Date: Tue Nov 11 19:08:42 2008
New Revision: 156086

URL: http://svn.digium.com/view/asterisk?view=rev&rev=156086
Log:
Don't allow a 0 rate cause a floating point error in the set_rate callback.

Modified:
    team/mmichelson/res_timing_timerfd/res/res_timing_timerfd.c

Modified: team/mmichelson/res_timing_timerfd/res/res_timing_timerfd.c
URL: http://svn.digium.com/view/asterisk/team/mmichelson/res_timing_timerfd/res/res_timing_timerfd.c?view=diff&rev=156086&r1=156085&r2=156086
==============================================================================
--- team/mmichelson/res_timing_timerfd/res/res_timing_timerfd.c (original)
+++ team/mmichelson/res_timing_timerfd/res/res_timing_timerfd.c Tue Nov 11 19:08:42 2008
@@ -131,7 +131,7 @@
 {
 	struct itimerspec itspec;
 	itspec.it_value.tv_sec = 0;
-	itspec.it_value.tv_nsec = (long) (1000000000 / rate);
+	itspec.it_value.tv_nsec = rate ? (long) (1000000000 / rate) : 0L;
 	itspec.it_interval.tv_sec = itspec.it_value.tv_sec;
 	itspec.it_interval.tv_nsec = itspec.it_value.tv_nsec;
 
@@ -182,7 +182,7 @@
 	}
 
 	memset(&continuous_timer, 0, sizeof(continuous_timer));
-	continuous_timer.it_value.tv_nsec = 1;
+	continuous_timer.it_value.tv_nsec = 1L;
 	
 	res = timerfd_settime(handle, 0, &continuous_timer, &our_timer->saved_timer);
 	our_timer->is_continuous = 1;




More information about the asterisk-commits mailing list