[Pcsclite-git-commit] [PCSC] 02/16: IFDPowerICC(): Fix internal use of IFDStatusICC()

Ludovic Rousseau rousseau at moszumanska.debian.org
Thu May 11 16:26:03 UTC 2017


This is an automated email from the git hooks/post-receive script.

rousseau pushed a commit to branch master
in repository PCSC.

commit b024b2ac275eaefecb2553710242d29f607a376f
Author: Ludovic Rousseau <ludovic.rousseau at free.fr>
Date:   Thu May 11 11:01:49 2017 +0200

    IFDPowerICC(): Fix internal use of IFDStatusICC()
    
    IFDStatusICC() is not a IFDHandler function but a ifdwrapper function.
    It returns SCARD_* values and not IFD_* values.
    
    By luck, the code was not broken because we have
    IFD_SUCCESS = SCARD_S_SUCCESS = 0
---
 src/ifdwrapper.c | 9 ++-------
 1 file changed, 2 insertions(+), 7 deletions(-)

diff --git a/src/ifdwrapper.c b/src/ifdwrapper.c
index 15fe4ed..4710690 100644
--- a/src/ifdwrapper.c
+++ b/src/ifdwrapper.c
@@ -288,13 +288,8 @@ LONG IFDPowerICC(READER_CONTEXT * rContext, DWORD dwAction,
 	 * Check that the card is inserted first
 	 */
 	rv = IFDStatusICC(rContext, &dwStatus);
-	if (rv != IFD_SUCCESS)
-	{
-		if (rv == IFD_NO_SUCH_DEVICE)
-			return SCARD_E_READER_UNAVAILABLE;
-
-		return SCARD_E_NOT_TRANSACTED;
-	}
+	if (rv != SCARD_S_SUCCESS)
+		return rv;
 
 	if (dwStatus & SCARD_ABSENT)
 		return SCARD_W_REMOVED_CARD;

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pcsclite/PCSC.git



More information about the Pcsclite-cvs-commit mailing list