On Mon, Aug 20, 2012 at 03:12:25PM +0200, Bjørn Mork wrote: > Alan Stern <stern@xxxxxxxxxxxxxxxxxxx> writes: > > On Mon, 20 Aug 2012, Bjørn Mork wrote: > > > >> I just noticed that /dev/ttyUSBx devices are not destroyed and released > >> on USB device disconnect if some process keeps the file open, and > >> reading from the file does not return an error - it successfully reads 0 > >> bytes instead. > > > > I could be wrong about this, but isn't reading from a hung-up tty > > supposed to be much like reaching end-of-file? That doesn't return an > > error either, but applications manage to deal with it somehow. > > Yes, you are both right. This works as expected and as it always has > done. End-of-file as implemented by the TTY layer is correct. > > I don't know where I got the idea that this used to work differently. I > just verified that gpsd will keep the device file open forever after > it's gone with previous kernels as well. As expected based on the age of > the code involved. Tested on 3.5 and 3.2. Don't know it it should be > considered a bug in gpsd, but it can easily be worked around using a > udev rule to signal gpsd that the device disappeared. No need for that, gpsd should be getting a hangup signal that the tty is gone. Hopefully it knows how to handle it properly. greg k-h -- To unsubscribe from this list: send the line "unsubscribe linux-usb" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html