[Pcsclite-cvs-commit] r7024 - trunk/Drivers/ccid/src

ludovic.rousseau at free.fr ludovic.rousseau at free.fr
Tue Nov 4 09:31:00 UTC 2014


Author: rousseau
Date: 2014-11-04 09:31:00 +0000 (Tue, 04 Nov 2014)
New Revision: 7024

Modified:
   trunk/Drivers/ccid/src/ccid_usb.c
Log:
Ignore errno and use libusb returned value only

Checking (ENODEV == errno) should always be redundant with
checking (LIBUSB_ERROR_NO_DEVICE == rv)

Since errno is not a documented way to deal with libusb errors we will
ignore errno now.

Thanks to Hendrik Donner for the patch
http://lists.alioth.debian.org/pipermail/pcsclite-muscle/Week-of-Mon-20141020/000205.html


Modified: trunk/Drivers/ccid/src/ccid_usb.c
===================================================================
--- trunk/Drivers/ccid/src/ccid_usb.c	2014-11-04 09:25:52 UTC (rev 7023)
+++ trunk/Drivers/ccid/src/ccid_usb.c	2014-11-04 09:31:00 UTC (rev 7024)
@@ -25,7 +25,6 @@
 
 #include <stdio.h>
 #include <string.h>
-#include <errno.h>
 # ifdef S_SPLINT_S
 # include <sys/types.h>
 # endif
@@ -747,7 +746,7 @@
 			usbDevice[reader_index].bus_number,
 			usbDevice[reader_index].device_address, rv, libusb_error_name(rv));
 
-		if ((ENODEV == errno) || (LIBUSB_ERROR_NO_DEVICE == rv))
+		if (LIBUSB_ERROR_NO_DEVICE == rv)
 			return STATUS_NO_SUCH_DEVICE;
 
 		return STATUS_UNSUCCESSFUL;
@@ -786,7 +785,7 @@
 			usbDevice[reader_index].bus_number,
 			usbDevice[reader_index].device_address, rv, libusb_error_name(rv));
 
-		if ((ENODEV == errno) || (LIBUSB_ERROR_NO_DEVICE == rv))
+		if (LIBUSB_ERROR_NO_DEVICE == rv)
 			return STATUS_NO_SUCH_DEVICE;
 
 		return STATUS_UNSUCCESSFUL;




More information about the Pcsclite-cvs-commit mailing list