Re: SELECT() returns 1 But FIONREAD says (Input/output error)

2007-06-01 Thread Uncle George
Robert Hancock wrote: It's because you haven't done anything to handle the error which is still persisting. Likely the only thing sane you can do in this case is close the fd and try to reopen it later. This seems to be true, but not for what you might think. It appears that if u plug the U

RE: SELECT() returns 1 But FIONREAD says (Input/output error)

2007-06-01 Thread David Schwartz
> David Schwartz wrote: > >> The misunderstanding is from the docs. > >> The select() does not report device errors. > >> Select will just "more precisely, to see if a read will not block". > > This is a much slighter misunderstanding. The result of the 'select' > > function tells you nothing ab

Re: SELECT() returns 1 But FIONREAD says (Input/output error)

2007-06-01 Thread Uncle George
David Schwartz wrote: The misunderstanding is from the docs. The select() does not report device errors. Select will just "more precisely, to see if a read will not block". This is a much slighter misunderstanding. The result of the 'select' function tells you nothing about what a particular 'r

RE: SELECT() returns 1 But FIONREAD says (Input/output error)

2007-06-01 Thread David Schwartz
> The misunderstanding is from the docs. > The select() does not report device errors. > Select will just "more precisely, to see if a read will not block". This is a much slighter misunderstanding. The result of the 'select' function tells you nothing about what a particular 'read' will or will

Re: SELECT() returns 1 But FIONREAD says (Input/output error)

2007-06-01 Thread Uncle George
David Schwartz wrote: David Schwartz wrote: Nope. An errored connection is always ready for read/write -- there is nothing to wait for as far as the kernel is concerned. Your code keeps asking the kernel if something interesting has happened, the kernel keeps telling it yes, and it refuses to

RE: SELECT() returns 1 But FIONREAD says (Input/output error)

2007-06-01 Thread David Schwartz
> David Schwartz wrote: > > Nope. An errored connection is always ready for read/write -- there is > > nothing to wait for as far as the kernel is concerned. Your code keeps > > asking the kernel if something interesting has happened, the > > kernel keeps > > telling it yes, and it refuses to do

Re: SELECT() returns 1 But FIONREAD says (Input/output error)

2007-06-01 Thread Bodo Eggert
Uncle George <[EMAIL PROTECTED]> wrote: > i am using the GARMIN_GPS/usb driver to read a gps receiver. > In testing the ability of my software to recover from various errors, I > try this: unplug the gps/USB cable from the usb hub. > > Interestingly enough the thread spins. > the SELECT() waits f

Re: SELECT() returns 1 But FIONREAD says (Input/output error)

2007-06-01 Thread Uncle George
David Schwartz wrote: In this case what, will reset the "something interesting has happened" report from the SELECT call? Will it ever be reset in this case? Nope. An errored connection is always ready for read/write -- there is nothing to wait for as far as the kernel is concerned. Your code

Re: SELECT() returns 1 But FIONREAD says (Input/output error)

2007-05-31 Thread Robert Hancock
Uncle George wrote: David Schwartz wrote: Nope. An errored connection is always ready for read/write -- there is nothing to wait for as far as the kernel is concerned. Your code keeps asking the kernel if something interesting has happened, the kernel keeps telling it yes, and it refuses to do

Re: SELECT() returns 1 But FIONREAD says (Input/output error)

2007-05-31 Thread Uncle George
David Schwartz wrote: Nope. An errored connection is always ready for read/write -- there is nothing to wait for as far as the kernel is concerned. Your code keeps asking the kernel if something interesting has happened, the kernel keeps telling it yes, and it refuses to do anything about it. T

RE: SELECT() returns 1 But FIONREAD says (Input/output error)

2007-05-31 Thread David Schwartz
> i am using the GARMIN_GPS/usb driver to read a gps receiver. > In testing the ability of my software to recover from various errors, I > try this: unplug the gps/USB cable from the usb hub. > > Interestingly enough the thread spins. > the SELECT() waits for something to happen, and I get one cha