pwc
[Top] [All Lists]

[pwc] [PATCH] pwc: do not block in VIDIOC_DQBUF

To:
Subject: [pwc] [PATCH] pwc: do not block in VIDIOC_DQBUF
From: Andrea <>
Date: Sat, 05 Jul 2008 14:24:07 +0100
I think the ioctl VIDIOC_DQBUF in pwc does not follow the API spec.
It should not block if there are no buffers and the device has been
opened with O_NONBLOCK.

I am not sure the patch is 100% correct, since I do not understand it
completely.

Andrea
diff -r 87aa6048e718 linux/drivers/media/video/pwc/pwc-v4l.c
--- a/linux/drivers/media/video/pwc/pwc-v4l.c   Wed Jul 02 08:59:38 2008 -0300
+++ b/linux/drivers/media/video/pwc/pwc-v4l.c   Sat Jul 05 14:14:03 2008 +0100
@@ -1134,6 +1134,13 @@
                                     frameq is safe now.
                         */
                        add_wait_queue(&pdev->frameq, &wait);
+
+                       if ((pdev->full_frames == NULL) && (file->f_flags & 
O_NONBLOCK)) {
+                               remove_wait_queue(&pdev->frameq, &wait);
+                               set_current_state(TASK_RUNNING);
+                               return -EAGAIN;
+                       }
+
                        while (pdev->full_frames == NULL) {
                                if (pdev->error_status) {
                                        remove_wait_queue(&pdev->frameq, &wait);
_______________________________________________
pwc mailing list

http://lists.saillard.org/mailman/listinfo/pwc
<Prev in Thread] Current Thread [Next in Thread>
  • [pwc] [PATCH] pwc: do not block in VIDIOC_DQBUF, Andrea <=
Admin

Disclaimer: Neither Andrew Taylor nor the University of NSW School of Computer and Engineering take any responsibility for the contents of this archive. It is purely a compilation of material sent by many people to the birding-aus mailing list. It has not been checked for accuracy nor its content verified in any way. If you wish to get material removed from the archive or have other queries about the archive e-mail Andrew Taylor at this address: andrewt@cse.unsw.EDU.AU