summaryrefslogtreecommitdiff
path: root/meta/packages/linux/linux-gta01/fix-EVIOCGRAB-semantics.patch
diff options
context:
space:
mode:
authorMarcin Juszkiewicz <hrw@openedhand.com>2007-08-29 11:48:12 +0000
committerMarcin Juszkiewicz <hrw@openedhand.com>2007-08-29 11:48:12 +0000
commitff0a6211cdbf0a142ab5d232670e6ed8b25716a7 (patch)
treedc101441b1e6c6acd62f53650ed1f0d5c6ac1e5f /meta/packages/linux/linux-gta01/fix-EVIOCGRAB-semantics.patch
parent2fc0b59463b1f5d8072370b876fa8abbe194e716 (diff)
downloadopenembedded-core-ff0a6211cdbf0a142ab5d232670e6ed8b25716a7.tar.gz
openembedded-core-ff0a6211cdbf0a142ab5d232670e6ed8b25716a7.tar.bz2
openembedded-core-ff0a6211cdbf0a142ab5d232670e6ed8b25716a7.tar.xz
openembedded-core-ff0a6211cdbf0a142ab5d232670e6ed8b25716a7.zip
linux-gta01: update to 2.6.21.6 from OE
git-svn-id: https://svn.o-hand.com/repos/poky/trunk@2593 311d38ba-8fff-0310-9ca6-ca027cbcb966
Diffstat (limited to 'meta/packages/linux/linux-gta01/fix-EVIOCGRAB-semantics.patch')
-rw-r--r--meta/packages/linux/linux-gta01/fix-EVIOCGRAB-semantics.patch97
1 files changed, 97 insertions, 0 deletions
diff --git a/meta/packages/linux/linux-gta01/fix-EVIOCGRAB-semantics.patch b/meta/packages/linux/linux-gta01/fix-EVIOCGRAB-semantics.patch
new file mode 100644
index 000000000..3c96faa27
--- /dev/null
+++ b/meta/packages/linux/linux-gta01/fix-EVIOCGRAB-semantics.patch
@@ -0,0 +1,97 @@
+diff --git a/drivers/input/evdev.c b/drivers/input/evdev.c
+index 12c7ab8..c7e741b 100644
+--- a/drivers/input/evdev.c
++++ b/drivers/input/evdev.c
+@@ -29,7 +29,7 @@ struct evdev {
+ char name[16];
+ struct input_handle handle;
+ wait_queue_head_t wait;
+- struct evdev_list *grab;
++ int grab;
+ struct list_head list;
+ };
+
+@@ -37,6 +37,7 @@ struct evdev_list {
+ struct input_event buffer[EVDEV_BUFFER_SIZE];
+ int head;
+ int tail;
++ int grab;
+ struct fasync_struct *fasync;
+ struct evdev *evdev;
+ struct list_head node;
+@@ -49,8 +50,7 @@ static void evdev_event(struct input_han
+ struct evdev *evdev = handle->private;
+ struct evdev_list *list;
+
+- if (evdev->grab) {
+- list = evdev->grab;
++ list_for_each_entry(list, &evdev->list, node) {
+
+ do_gettimeofday(&list->buffer[list->head].time);
+ list->buffer[list->head].type = type;
+@@ -59,17 +59,7 @@ static void evdev_event(struct input_han
+ list->head = (list->head + 1) & (EVDEV_BUFFER_SIZE - 1);
+
+ kill_fasync(&list->fasync, SIGIO, POLL_IN);
+- } else
+- list_for_each_entry(list, &evdev->list, node) {
+-
+- do_gettimeofday(&list->buffer[list->head].time);
+- list->buffer[list->head].type = type;
+- list->buffer[list->head].code = code;
+- list->buffer[list->head].value = value;
+- list->head = (list->head + 1) & (EVDEV_BUFFER_SIZE - 1);
+-
+- kill_fasync(&list->fasync, SIGIO, POLL_IN);
+- }
++ }
+
+ wake_up_interruptible(&evdev->wait);
+ }
+@@ -104,9 +94,10 @@ static int evdev_release(struct inode *
+ {
+ struct evdev_list *list = file->private_data;
+
+- if (list->evdev->grab == list) {
+- input_release_device(&list->evdev->handle);
+- list->evdev->grab = NULL;
++ if (list->grab) {
++ if(!--list->evdev->grab && list->evdev->exist)
++ input_release_device(&list->evdev->handle);
++ list->grab = 0;
+ }
+
+ evdev_fasync(-1, file, 0);
+@@ -483,17 +474,19 @@ static long evdev_ioctl_handler(struct f
+
+ case EVIOCGRAB:
+ if (p) {
+- if (evdev->grab)
+- return -EBUSY;
+- if (input_grab_device(&evdev->handle))
++ if (list->grab)
+ return -EBUSY;
+- evdev->grab = list;
++ if (!evdev->grab++)
++ if (input_grab_device(&evdev->handle))
++ return -EBUSY;
++ list->grab = 0;
+ return 0;
+ } else {
+- if (evdev->grab != list)
++ if (!list->grab)
+ return -EINVAL;
+- input_release_device(&evdev->handle);
+- evdev->grab = NULL;
++ if (!--evdev->grab)
++ input_release_device(&evdev->handle);
++ list->grab = 0;
+ return 0;
+ }
+
+-
+To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
+the body of a message to majordomo@vger.kernel.org
+More majordomo info at http://vger.kernel.org/majordomo-info.html
+Please read the FAQ at http://www.tux.org/lkml/
+