From 4cb90fceb779dbf33cfd9bcf28c66ffc737537f2 Mon Sep 17 00:00:00 2001 From: Samuel Thibault Date: Sat, 4 Jun 2016 23:14:46 +0200 Subject: 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. --- trans/new-fifo.c | 2 -- 1 file changed, 2 deletions(-) (limited to 'trans/new-fifo.c') diff --git a/trans/new-fifo.c b/trans/new-fifo.c index 0ceb8422..f11cecae 100644 --- a/trans/new-fifo.c +++ b/trans/new-fifo.c @@ -623,7 +623,6 @@ io_select_common (struct trivfs_protid *cred, } else { - err = EBADF; ready |= SELECT_READ; /* Error immediately available... */ } if (err) @@ -645,7 +644,6 @@ io_select_common (struct trivfs_protid *cred, } else { - err = EBADF; ready |= SELECT_WRITE; /* Error immediately available... */ } } -- cgit v1.2.3