2017-10-04 00:19:51 +02:00
|
|
|
From c4ee285e4bb85caa69a1870f313a22c1214bb5c6 Mon Sep 17 00:00:00 2001
|
2011-12-11 03:42:09 +01:00
|
|
|
From: Alexander Graf <agraf@suse.de>
|
2009-08-11 17:37:13 +02:00
|
|
|
Date: Tue, 14 Apr 2009 16:27:36 +0200
|
2012-02-01 00:10:40 +01:00
|
|
|
Subject: [PATCH] qemu-cvs-ioctl_nodirection
|
2009-08-11 17:37:13 +02:00
|
|
|
|
|
|
|
the direction given in the ioctl should be correct so we can assume the
|
|
|
|
communication is uni-directional. The alsa developers did not like this
|
|
|
|
concept though and declared ioctls IOC_R and IOC_W even though they were
|
|
|
|
IOC_RW.
|
|
|
|
|
2011-12-11 03:42:09 +01:00
|
|
|
Signed-off-by: Alexander Graf <agraf@suse.de>
|
2009-08-11 17:37:13 +02:00
|
|
|
Signed-off-by: Ulrich Hecht <uli@suse.de>
|
|
|
|
---
|
2014-01-17 23:04:30 +01:00
|
|
|
linux-user/syscall.c | 6 ++++++
|
|
|
|
1 file changed, 6 insertions(+)
|
2009-08-11 17:37:13 +02:00
|
|
|
|
|
|
|
diff --git a/linux-user/syscall.c b/linux-user/syscall.c
|
2017-08-31 00:22:50 +02:00
|
|
|
index cf290dbf4b..1802aec4cb 100644
|
2009-08-11 17:37:13 +02:00
|
|
|
--- a/linux-user/syscall.c
|
|
|
|
+++ b/linux-user/syscall.c
|
2017-08-31 00:22:50 +02:00
|
|
|
@@ -5652,6 +5652,11 @@ static abi_long do_ioctl(int fd, int cmd, abi_long arg)
|
2009-08-11 17:37:13 +02:00
|
|
|
arg_type++;
|
|
|
|
target_size = thunk_type_size(arg_type, 0);
|
|
|
|
switch(ie->access) {
|
|
|
|
+ /* FIXME: actually the direction given in the ioctl should be
|
|
|
|
+ * correct so we can assume the communication is uni-directional.
|
|
|
|
+ * The alsa developers did not like this concept though and
|
|
|
|
+ * declared ioctls IOC_R and IOC_W even though they were IOC_RW.*/
|
|
|
|
+/*
|
|
|
|
case IOC_R:
|
2016-09-19 19:06:58 +02:00
|
|
|
ret = get_errno(safe_ioctl(fd, ie->host_cmd, buf_temp));
|
2009-08-11 17:37:13 +02:00
|
|
|
if (!is_error(ret)) {
|
2017-08-31 00:22:50 +02:00
|
|
|
@@ -5670,6 +5675,7 @@ static abi_long do_ioctl(int fd, int cmd, abi_long arg)
|
2009-08-11 17:37:13 +02:00
|
|
|
unlock_user(argptr, arg, 0);
|
2016-09-19 19:06:58 +02:00
|
|
|
ret = get_errno(safe_ioctl(fd, ie->host_cmd, buf_temp));
|
2009-08-11 17:37:13 +02:00
|
|
|
break;
|
|
|
|
+*/
|
|
|
|
default:
|
|
|
|
case IOC_RW:
|
|
|
|
argptr = lock_user(VERIFY_READ, arg, target_size, 1);
|