summaryrefslogtreecommitdiff
path: root/console-client
diff options
context:
space:
mode:
authorSamuel Thibault <samuel.thibault@ens-lyon.org>2016-06-04 23:14:46 +0200
committerSamuel Thibault <samuel.thibault@ens-lyon.org>2016-06-04 23:14:46 +0200
commit4cb90fceb779dbf33cfd9bcf28c66ffc737537f2 (patch)
tree5892ac09e6e04b262d89b6d23cd77eee894db36d /console-client
parenta8b8ece4ff36fca27492f0a4e925e2f4453ee483 (diff)
Do not make io_select return errors on unsupported READ/WRITE mode
The descriptor is valid, it is just the mode which is not available. * console-client/kbd-repeat.c (repeater_select): Drop SELECT_URG flag from `type'. Return 0 instead of EINVAL if `type' contains SELECT_WRITE. * console-client/pc-mouse (repeater_select): Likewise. * trans/mtab.c (trivfs_S_io_select): Return 0 instead of EBADF when the openmodes do not match the requested modes in `type'. * trans/new-fifo.c (io_select_common): Likewise. * trans/fifo.c (io_select_common): Likewise. * trans/null.c (trivfs_S_io_select): Likewise. * trans/streamio.c (io_select_common): Likewise.
Diffstat (limited to 'console-client')
-rw-r--r--console-client/kbd-repeat.c5
-rw-r--r--console-client/pc-mouse.c5
2 files changed, 8 insertions, 2 deletions
diff --git a/console-client/kbd-repeat.c b/console-client/kbd-repeat.c
index d3a39d07..8d8c9ee8 100644
--- a/console-client/kbd-repeat.c
+++ b/console-client/kbd-repeat.c
@@ -94,8 +94,11 @@ repeater_select (struct protid *cred, mach_port_t reply,
if (!cred)
return EOPNOTSUPP;
+ *type &= ~SELECT_URG;
+
if (*type & ~SELECT_READ)
- return EINVAL;
+ /* Error immediately available... */
+ return 0;
if (*type == 0)
return 0;
diff --git a/console-client/pc-mouse.c b/console-client/pc-mouse.c
index abdb602b..40a569d0 100644
--- a/console-client/pc-mouse.c
+++ b/console-client/pc-mouse.c
@@ -118,8 +118,11 @@ repeater_select (struct protid *cred, mach_port_t reply,
if (!cred)
return EOPNOTSUPP;
+ *type &= ~SELECT_URG;
+
if (*type & ~SELECT_READ)
- return EINVAL;
+ /* Error immediately available... */
+ return 0;
if (*type == 0)
return 0;