File acsccid-1.1.12-polling-unplug.patch of Package pcsc-acsccid
Index: acsccid-1.1.12/src/ccid_usb.c
===================================================================
--- acsccid-1.1.12.orig/src/ccid_usb.c
+++ acsccid-1.1.12/src/ccid_usb.c
@@ -1940,6 +1940,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;
}
@@ -1959,6 +1961,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;
}
}
@@ -2013,7 +2017,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;