[Pcsclite-muscle] ccid_usb.c error handling

Hendrik hendrik.donner
Fri Oct 24 13:57:43 PDT 2014


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.

Best regards,
Hendrik

-------------- next part --------------
A non-text attachment was scrubbed...
Name: ccid_error_handling.patch
Type: text/x-patch
Size: 1002 bytes
Desc: not available
URL: <http://lists.alioth.debian.org/pipermail/pcsclite-muscle/attachments/20141024/b77acc56/attachment.bin>



More information about the pcsclite-muscle mailing list