linux_usbfs: Set reap action to CANCELLED only when successful
authorChris Dickens <christopher.a.dickens@gmail.com>
Mon, 3 Aug 2015 06:19:57 +0000 (23:19 -0700)
committerChris Dickens <christopher.a.dickens@gmail.com>
Wed, 5 Aug 2015 05:52:14 +0000 (22:52 -0700)
commit13a90e43acd40e0993790ac354eb7a5a3745a2b2
tree341628d1474a4bcd5dcab469d5a8415a8c68f713
parenta6a7b53b6312ac06df87e501bf65340b457d0aaf
linux_usbfs: Set reap action to CANCELLED only when successful

Prior to this commit, a call to libusb_cancel_transfer() would set
the reap action of the transfer to CANCELLED regardless of whether
the cancellation was successful or not. This can cause the transfer
status to incorrectly report LIBUSB_TRANSFER_CANCELLED when in some
cases this is not the case. This commit adds a check for a successful
cancellation before setting the reap action as such.

Signed-off-by: Chris Dickens <christopher.a.dickens@gmail.com>
libusb/os/linux_usbfs.c
libusb/version_nano.h