Re: read() from removed usb-serial device

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, Jul 07, 2020 at 04:49:31PM +0200, Frank Schäfer wrote:
> Hi,
> 
> I recently noticed that read() from a usb-serial device does not fail after
> the device got removed.
> Is this really the correct/expected behavior or a bug ?

You application did not get the hangup event and stop reading?

> I would expect it to return -1 and set an appropriate errno, but it returns
> 0 (no error, no bytes read) instead.

0 is correct here, why would there be an error?  There's no data for you
to read from a device that is gone :)

thanks,

greg k-h



[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux