From: Anthony Minessale Date: Mon, 19 Jan 2009 16:53:51 +0000 (+0000) Subject: no timers with 0 interval X-Git-Tag: v1.0.3~675 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ef81877139dde71949f53519fbc8decd296dcad3;p=thirdparty%2Ffreeswitch.git no timers with 0 interval git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@11280 d0543943-73ff-0310-b7d9-9358b9ac24b2 --- diff --git a/src/switch_time.c b/src/switch_time.c index ed717ee4be..94370f0b8d 100644 --- a/src/switch_time.c +++ b/src/switch_time.c @@ -238,7 +238,7 @@ static switch_status_t timer_init(switch_timer_t *timer) } } - if (globals.RUNNING != 1 || !globals.mutex) { + if (globals.RUNNING != 1 || !globals.mutex || timer->interval < 1) { return SWITCH_STATUS_FALSE; } @@ -255,7 +255,7 @@ static switch_status_t timer_init(switch_timer_t *timer) private_info->roll = TIMER_MATRIX[timer->interval].roll; private_info->ready = 1; - if (timer->interval < MS_PER_TICK) { + if (timer->interval > 0 && timer->interval < MS_PER_TICK) { MS_PER_TICK = timer->interval; }