diff options
author | Samuel Thibault <samuel.thibault@ens-lyon.org> | 2016-06-04 23:14:46 +0200 |
---|---|---|
committer | Samuel Thibault <samuel.thibault@ens-lyon.org> | 2016-06-04 23:14:46 +0200 |
commit | 4cb90fceb779dbf33cfd9bcf28c66ffc737537f2 (patch) | |
tree | 5892ac09e6e04b262d89b6d23cd77eee894db36d /trans/null.c | |
parent | a8b8ece4ff36fca27492f0a4e925e2f4453ee483 (diff) | |
download | hurd-4cb90fceb779dbf33cfd9bcf28c66ffc737537f2.tar.gz hurd-4cb90fceb779dbf33cfd9bcf28c66ffc737537f2.tar.bz2 hurd-4cb90fceb779dbf33cfd9bcf28c66ffc737537f2.zip |
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 'trans/null.c')
-rw-r--r-- | trans/null.c | 6 |
1 files changed, 1 insertions, 5 deletions
diff --git a/trans/null.c b/trans/null.c index bd082dc8..92717ed8 100644 --- a/trans/null.c +++ b/trans/null.c @@ -204,11 +204,7 @@ trivfs_S_io_select (struct trivfs_protid *cred, { if (!cred) return EOPNOTSUPP; - else if (((*type & SELECT_READ) && !(cred->po->openmodes & O_READ)) - || ((*type & SELECT_WRITE) && !(cred->po->openmodes & O_WRITE))) - return EBADF; - else - *type &= ~SELECT_URG; + *type &= ~SELECT_URG; return 0; } |