File acsccid-1.1.13-polling-unplug.patch of Package pcsc-acsccid
Index: acsccid-1.1.13/src/ccid_usb.c
===================================================================
--- acsccid-1.1.13.orig/src/ccid_usb.c
+++ acsccid-1.1.13/src/ccid_usb.c
@@ -1993,6 +1993,8 @@ int InterruptRead(int reader_index, int
libusb_free_transfer(transfer);
DEBUG_CRITICAL2("libusb_submit_transfer failed: %s",
libusb_error_name(ret));
+ if (ret == LIBUSB_ERROR_NO_DEVICE)
+ return IFD_NO_SUCH_DEVICE;
return IFD_COMMUNICATION_ERROR;
}
@@ -2012,6 +2014,8 @@ int InterruptRead(int reader_index, int
libusb_free_transfer(transfer);
DEBUG_CRITICAL2("libusb_handle_events failed: %s",
libusb_error_name(ret));
+ if (ret == LIBUSB_ERROR_NO_DEVICE)
+ return IFD_NO_SUCH_DEVICE;
return IFD_COMMUNICATION_ERROR;
}
}
@@ -2066,7 +2070,10 @@ int InterruptRead(int reader_index, int
DEBUG_COMM4("InterruptRead (%d/%d): %d",
usbDevice[reader_index].bus_number,
usbDevice[reader_index].device_address, ret);
- return_value = IFD_COMMUNICATION_ERROR;
+ if (ret == LIBUSB_TRANSFER_NO_DEVICE)
+ return_value = IFD_NO_SUCH_DEVICE;
+ else
+ return_value = IFD_COMMUNICATION_ERROR;
}
return return_value;