[Pcsclite-cvs-commit] r4482 - /trunk/PCSC/src/winscard_clnt.c

rousseau at users.alioth.debian.org rousseau at users.alioth.debian.org
Mon Oct 12 14:27:35 UTC 2009


Author: rousseau
Date: Mon Oct 12 14:27:34 2009
New Revision: 4482

URL: http://svn.debian.org/wsvn/pcsclite/?sc=1&rev=4482
Log:
SCardConnect(): factorize exit code

Modified:
    trunk/PCSC/src/winscard_clnt.c

Modified: trunk/PCSC/src/winscard_clnt.c
URL: http://svn.debian.org/wsvn/pcsclite/trunk/PCSC/src/winscard_clnt.c?rev=4482&op=diff
==============================================================================
--- trunk/PCSC/src/winscard_clnt.c (original)
+++ trunk/PCSC/src/winscard_clnt.c Mon Oct 12 14:27:34 2009
@@ -748,8 +748,8 @@
 
 	if (rv == -1)
 	{
-		(void)SYS_MutexUnLock(psContextMap[dwContextIndex].mMutex);
-		return SCARD_E_NO_SERVICE;
+		rv = SCARD_E_NO_SERVICE;
+		goto end;
 	}
 
 	/*
@@ -761,8 +761,8 @@
 
 	if (rv == -1)
 	{
-		(void)SYS_MutexUnLock(psContextMap[dwContextIndex].mMutex);
-		return SCARD_F_COMM_ERROR;
+		rv = SCARD_F_COMM_ERROR;
+		goto end;
 	}
 
 	*phCard = scConnectStruct.hCard;
@@ -774,18 +774,16 @@
 		 * Keep track of the handle locally
 		 */
 		rv = SCardAddHandle(*phCard, dwContextIndex, szReader);
-		(void)SYS_MutexUnLock(psContextMap[dwContextIndex].mMutex);
-
-		PROFILE_END(rv)
-
-		return rv;
-	}
-
+	}
+	else
+		rv = scConnectStruct.rv;
+
+end:
 	(void)SYS_MutexUnLock(psContextMap[dwContextIndex].mMutex);
 
 	PROFILE_END(scConnectStruct.rv)
 
-	return scConnectStruct.rv;
+	return rv;
 }
 
 /**




More information about the Pcsclite-cvs-commit mailing list