Thread (6 messages) flat view 6 messages, 2 authors, 2012-04-02

Re: [PATCH RESEND 2/2] Input: uinput: Avoid returning 0 on read()

From: David Herrmann <hidden>
Date: 2012-03-31 08:39:50

Hi Dmitry

On Sat, Mar 31, 2012 at 8:00 AM, Dmitry Torokhov
[off-list ref] wrote:
Hi David,
<snip>
I agree that we should return -EINVAL when buffer is too small. I
however do not like the whole "try_again" business; I think it is
perfectly fine to return 0 for blocking reads, we just want to return
-EAGAIN for nonblocking.
The read() manpage says that return-code 0 means the fd got closed.
Does the VFS layer forward the return-code untouched to user-space or
why do you think returning 0 is fine? At least my uinput user-space
apps handle read()==0 as failure.
I changed around your patches a bit and will post them shortly.
Apart from the ret==0 issue I have nothing to object. If you want to
apply them the way they're now, I am ok with it, too. Thanks for
cleaning them up.
Aristeu, since the patches changed somewhat I dropped your Acked-by so
please Ack the patches you are comfortable with again.

Thanks.

--
Dmitry
Thanks
David
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help