diff options
author | Shaun Ruffell <sruffell@digium.com> | 2011-06-28 15:55:44 +0000 |
---|---|---|
committer | Shaun Ruffell <sruffell@digium.com> | 2011-06-28 15:55:44 +0000 |
commit | 41587736ebc8090e79f7cb3b11a8ef9abe4e77b3 (patch) | |
tree | dd4672aa6a9b0213db556ff97332d339b565e832 /drivers/dahdi/dahdi-base.c | |
parent | be132e667529757d25d0f655aa6b3a8a9ab0ed51 (diff) |
Revert "dahdi: If a timer is not configured then we should block indefinitely."
This reverts commit r9937 and is part of two commits to revert all the timer
changes.
Grouping the timer into rates did not allow a timers rate to be changed after
another thread is already blocked on the poll call
Signed-off-by: Shaun Ruffell <sruffell@digium.com>
Acked-by: Russ Meyerriecks <rmeyerriecks@digium.com>
git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@9990 a0bf4364-ded3-4de4-8d8a-66a801d63aff
Diffstat (limited to 'drivers/dahdi/dahdi-base.c')
-rw-r--r-- | drivers/dahdi/dahdi-base.c | 32 |
1 files changed, 3 insertions, 29 deletions
diff --git a/drivers/dahdi/dahdi-base.c b/drivers/dahdi/dahdi-base.c index bded1c0..b72576d 100644 --- a/drivers/dahdi/dahdi-base.c +++ b/drivers/dahdi/dahdi-base.c @@ -8751,40 +8751,14 @@ static void process_timers(void) spin_unlock(&dahdi_timer_lock); } -/** - * dahdi_timer_poll - Poll function for a dahdi_timer. - * @file: Open timer handle. - * @wait_table: Just passing through... - * - * Returns 0 if there isn't anything to wake us up, otherwise POLLPRI if there - * is an event waiting on the timer. - * - * Older versions of Asterisk depend on the behavior that this poll will block - * indefintely if the timer has not been configured, so if there is no rate - * attached to the timer, this function must return 0. - * - */ -static unsigned int -dahdi_timer_poll(struct file *file, struct poll_table_struct *wait_table) +static unsigned int dahdi_timer_poll(struct file *file, struct poll_table_struct *wait_table) { struct dahdi_timer *timer = file->private_data; - struct dahdi_timer_rate *rate; + struct dahdi_timer_rate *rate = timer->rate; - if (!timer) + if (!rate || !timer) return -EINVAL; - rate = timer->rate; - - if (!rate) { - static bool __once; - if (!__once) { - __once = true; - module_printk(KERN_NOTICE, - "Calling poll on unconfigured timer.\n"); - } - return 0; - } - poll_wait(file, &rate->sel, wait_table); if (atomic_read(&timer->tripped) || atomic_read(&timer->ping)) return POLLPRI; |