[Pcsclite-cvs-commit] r5205 - in /trunk/Drivers/ccid/src: ccid_usb.c ifdhandler.c

rousseau at users.alioth.debian.org rousseau at users.alioth.debian.org
Tue Aug 31 08:55:57 UTC 2010


Author: rousseau
Date: Tue Aug 31 08:55:56 2010
New Revision: 5205

URL: http://svn.debian.org/wsvn/pcsclite/?sc=1&rev=5205
Log:
Convert the return value from libusb code to IFD_* in InterruptRead()
instead of IFDHPolling().

We do not return IFD_NO_SUCH_DEVICE any more. This value will be
returned by the next libusb_*() call

Modified:
    trunk/Drivers/ccid/src/ccid_usb.c
    trunk/Drivers/ccid/src/ifdhandler.c

Modified: trunk/Drivers/ccid/src/ccid_usb.c
URL: http://svn.debian.org/wsvn/pcsclite/trunk/Drivers/ccid/src/ccid_usb.c?rev=5205&op=diff
==============================================================================
--- trunk/Drivers/ccid/src/ccid_usb.c (original)
+++ trunk/Drivers/ccid/src/ccid_usb.c Tue Aug 31 08:55:56 2010
@@ -1005,6 +1005,7 @@
 int InterruptRead(int reader_index, int timeout /* in ms */)
 {
 	int ret, actual_length;
+	int return_value = IFD_SUCCESS;
 	unsigned char buffer[8];
 	struct libusb_transfer *transfer;
 	int completed = 0;
@@ -1067,9 +1068,10 @@
 			DEBUG_COMM4("InterruptRead (%d/%d): %s",
 				usbDevice[reader_index].bus_number,
 				usbDevice[reader_index].device_address, strerror(errno));
-	}
-
-	return ret;
+			return_value = IFD_COMMUNICATION_ERROR;
+	}
+
+	return return_value;
 } /* InterruptRead */
 
 

Modified: trunk/Drivers/ccid/src/ifdhandler.c
URL: http://svn.debian.org/wsvn/pcsclite/trunk/Drivers/ccid/src/ifdhandler.c?rev=5205&op=diff
==============================================================================
--- trunk/Drivers/ccid/src/ifdhandler.c (original)
+++ trunk/Drivers/ccid/src/ifdhandler.c Tue Aug 31 08:55:56 2010
@@ -334,12 +334,7 @@
 	if (LogLevel & DEBUG_LEVEL_PERIODIC)
 		DEBUG_INFO3("%s (lun: %X)", CcidSlots[reader_index].readerName, Lun);
 
-	ret = InterruptRead(reader_index, 60*60*1000);	/* 1 hour */
-	if (ret > 0)
-		return IFD_SUCCESS;
-	if (0 == ret)
-		return IFD_NO_SUCH_DEVICE;
-	return IFD_COMMUNICATION_ERROR;
+	return InterruptRead(reader_index, 60*60*1000);	/* 1 hour */
 }
 
 /* on an ICCD device the card is always inserted




More information about the Pcsclite-cvs-commit mailing list