OSDN Git Service

staging: comedi: COMEDI_BUFINFO: return -EPIPE for abnormal read
authorIan Abbott <abbotti@mev.co.uk>
Fri, 19 Feb 2016 16:13:56 +0000 (16:13 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 20 Feb 2016 23:25:58 +0000 (15:25 -0800)
commit36a5117018a19d3694f841d91b6b8430260756e1
treef2262dfe73d21460bfd732637c826f4e9954a891
parentf3aa8c0becfb1d968e552721cc1be8b91032539b
staging: comedi: COMEDI_BUFINFO: return -EPIPE for abnormal read

The `COMEDI_BUFINFO` ioctl is used to advance the current position in
the buffer by a specified amount (which can be 0) and get the current
position.  If an asynchronous command in the "read" direction has
stopped normally, the command is terminated as soon as the position has
been advanced to the end of all available data.  This is not currently
done if the command terminated with an error.  Change it to allow the
command to be terminated even if it stopped with an error, but report an
`EPIPE` error to the user first.  The `EPIPE` error will not be
reported until the "read" position reported back to the user has been
advanced to the end of all available data.

Signed-off-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/comedi/comedi_fops.c