[Pcsclite-muscle] ccid_usb.c error handling
Ludovic Rousseau
ludovic.rousseau
Sun Oct 26 10:05:40 PDT 2014
2014-10-24 22:57 GMT+02:00 Hendrik <hendrik.donner at gmx.de>:
> Hello,
Hello,
> i wondered about the error handling in the ReadUSB()/WriteUSB()
> functions in ccid_usb.c.
>
> After the call to libusb_bulk_transfer errno is checked and
> strerror(errno) printed to the log, resulting in confusing logs because
> the return value of libusb_bulk_transfer might indicate an error but
> strerror(errno) returns 'Success'.
>
> The libusb 1.0 API documentation does not mention that errno is set by
> libusb_bulk_transfer, so don't use it.
>
> The attached patch should clean that up and is compile tested.
Thanks for the patch.
The problem is that libusb_strerror() has been introduced in "recent"
version of libusb (libusb 1.0.16 from 2013-07-11).
So compiling the driver with "old" Linux distributions (like Debian
stable using libusb 1.0.11) will be problematic.
The solution would be to use #ifdef in the code. I will try to think
about the problem again.
Bye,
--
Dr. Ludovic Rousseau
More information about the pcsclite-muscle
mailing list