]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
no timers with 0 interval
authorAnthony Minessale <anthony.minessale@gmail.com>
Mon, 19 Jan 2009 16:53:51 +0000 (16:53 +0000)
committerAnthony Minessale <anthony.minessale@gmail.com>
Mon, 19 Jan 2009 16:53:51 +0000 (16:53 +0000)
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@11280 d0543943-73ff-0310-b7d9-9358b9ac24b2

src/switch_time.c

index ed717ee4beddfc4c7d787321b30faa783beb5b23..94370f0b8d2a7e91531f301c368f607aea7f1a3f 100644 (file)
@@ -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;
                }