Hi Ryan, On Friday, 16. November 2012 11:10:00 Ryan C. Underwood wrote: > This patch fixes misleading errors being sent to the application from > libftdi. > > Background: usb_open() will silently succeed when the device node can > only be opened read-only and not read-write. When this occurs, > various subsequent ioctls to that node will fail, and are presented to > the application as failures of those specific operations, even though > the root cause is a permissions error. > > Using usb_claim_interface after every usb_open() would reveal a > permissions problem earlier, but it is desirable in this case to scan > properties of USB devices to find FTDI chips without necessarily > attempting to claim every device for exclusive access. > > The patch ensures that when libftdi performs a libusb operation on an > opened but not claimed USB device, a failure due to a permissions > error will be propagated to the application as a permissions error and > not a different, red-herring error.
Nice patch! One question: What about using a new, separate error code for the "permission denied" situation? Like -12. Cheers, Thomas -- libftdi - see http://www.intra2net.com/en/developer/libftdi for details. To unsubscribe send a mail to [email protected]
