summaryrefslogtreecommitdiff
path: root/zaptel.c
diff options
context:
space:
mode:
Diffstat (limited to 'zaptel.c')
-rwxr-xr-xzaptel.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/zaptel.c b/zaptel.c
index ebea1ee..05c8b26 100755
--- a/zaptel.c
+++ b/zaptel.c
@@ -3394,24 +3394,25 @@ static int zt_chanandpseudo_ioctl(struct inode *inode, struct file *file, unsign
chan->iomask = 0;
break;
case ZT_GETEVENT: /* Get event on queue */
- spin_lock_irqsave(&chan->lock, flags);
/* set up for no event */
- put_user(ZT_EVENT_NONE,(int *)data);
+ j = ZT_EVENT_NONE;
+ spin_lock_irqsave(&chan->lock, flags);
/* if some event in queue */
if (chan->eventinidx != chan->eventoutidx)
{
+ j = chan->eventbuf[chan->eventoutidx++];
/* get the data, bump index */
- put_user(chan->eventbuf[chan->eventoutidx++],(int *)data);
/* if index overflow, set to beginning */
if (chan->eventoutidx >= ZT_MAX_EVENTSIZE)
chan->eventoutidx = 0;
}
spin_unlock_irqrestore(&chan->lock, flags);
+ put_user(j,(int *)data);
break;
case ZT_CONFMUTE: /* set confmute flag */
+ get_user(j,(int *)data); /* get conf # */
if (!(chan->flags & ZT_FLAG_AUDIO)) return (-EINVAL);
spin_lock_irqsave(&bigzaplock, flags);
- get_user(j,(int *)data); /* get conf # */
chan->confmute = j;
spin_unlock_irqrestore(&bigzaplock, flags);
break;