Module: xenomai-abe
Branch: analogy
Commit: 2b1efb3818166b57bfa87286309243a1aa20914c
URL:    
http://git.xenomai.org/?p=xenomai-abe.git;a=commit;h=2b1efb3818166b57bfa87286309243a1aa20914c

Author: Daniele Nicolodi <nicol...@science.unitn.it>
Date:   Fri Mar 19 00:17:23 2010 +0100

analogy: fix a bug in a4l_ioctl_bufinfo when idle

---

 ksrc/drivers/analogy/buffer.c |   10 ++++++++++
 1 files changed, 10 insertions(+), 0 deletions(-)

diff --git a/ksrc/drivers/analogy/buffer.c b/ksrc/drivers/analogy/buffer.c
index aa6acac..bbd79ec 100644
--- a/ksrc/drivers/analogy/buffer.c
+++ b/ksrc/drivers/analogy/buffer.c
@@ -557,6 +557,14 @@ int a4l_ioctl_bufinfo(a4l_cxt_t * cxt, void *arg)
 
        buf = dev->transfer.bufs[info.idx_subd];
 
+       /* If a transfer is not occuring, simply return buffer
+          informations, otherwise make the transfer progress */
+       if (!test_bit(A4L_TSF_BUSY,
+                      &(dev->transfer.status[info.idx_subd]))) {
+               info.rw_count = 0;
+               goto a4l_ioctl_bufinfo_out;
+       }
+
        ret = __handle_event(buf);
 
        if (info.idx_subd == dev->transfer.idx_read_subd) {
@@ -618,6 +626,8 @@ int a4l_ioctl_bufinfo(a4l_cxt_t * cxt, void *arg)
                buf->mng_count += tmp_cnt;
        }
 
+a4l_ioctl_bufinfo_out: 
+
        /* Sets the buffer size */
        info.buf_size = buf->size;
 


_______________________________________________
Xenomai-git mailing list
Xenomai-git@gna.org
https://mail.gna.org/listinfo/xenomai-git

Reply via email to