[Pcsclite-cvs-commit] r4442 - /trunk/PCSC/src/winscard_clnt.c
rousseau at users.alioth.debian.org
rousseau at users.alioth.debian.org
Thu Oct 8 07:37:21 UTC 2009
Author: rousseau
Date: Thu Oct 8 07:37:21 2009
New Revision: 4442
URL: http://svn.debian.org/wsvn/pcsclite/?sc=1&rev=4442
Log:
SCardReconnect(): return SCARD_E_SHARING_VIOLATION instead of blocking
if the reader cannot be shared.
This change was made in revision 2475 but I don't remember why.
Thanks to Paul Klissner for the bug report
http://archives.neohapsis.com/archives/dev/muscle/2009-q3/0106.html
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=4442&op=diff
==============================================================================
--- trunk/PCSC/src/winscard_clnt.c (original)
+++ trunk/PCSC/src/winscard_clnt.c Thu Oct 8 07:37:21 2009
@@ -915,39 +915,36 @@
goto end;
}
- do
- {
- scReconnectStruct.hCard = hCard;
- scReconnectStruct.dwShareMode = dwShareMode;
- scReconnectStruct.dwPreferredProtocols = dwPreferredProtocols;
- scReconnectStruct.dwInitialization = dwInitialization;
- scReconnectStruct.dwActiveProtocol = *pdwActiveProtocol;
- scReconnectStruct.rv = SCARD_S_SUCCESS;
-
- rv = SHMMessageSendWithHeader(SCARD_RECONNECT, psContextMap[dwContextIndex].dwClientID,
+ scReconnectStruct.hCard = hCard;
+ scReconnectStruct.dwShareMode = dwShareMode;
+ scReconnectStruct.dwPreferredProtocols = dwPreferredProtocols;
+ scReconnectStruct.dwInitialization = dwInitialization;
+ scReconnectStruct.dwActiveProtocol = *pdwActiveProtocol;
+ scReconnectStruct.rv = SCARD_S_SUCCESS;
+
+ rv = SHMMessageSendWithHeader(SCARD_RECONNECT, psContextMap[dwContextIndex].dwClientID,
sizeof(scReconnectStruct),
PCSCLITE_READ_TIMEOUT, (void *) &scReconnectStruct);
- if (rv == -1)
- {
- (void)SYS_MutexUnLock(psContextMap[dwContextIndex].mMutex);
- return SCARD_E_NO_SERVICE;
- }
-
- /*
- * Read a message from the server
- */
- rv = SHMMessageReceive(&scReconnectStruct,
+ if (rv == -1)
+ {
+ (void)SYS_MutexUnLock(psContextMap[dwContextIndex].mMutex);
+ return SCARD_E_NO_SERVICE;
+ }
+
+ /*
+ * Read a message from the server
+ */
+ rv = SHMMessageReceive(&scReconnectStruct,
sizeof(scReconnectStruct),
psContextMap[dwContextIndex].dwClientID,
PCSCLITE_READ_TIMEOUT);
- if (rv == -1)
- {
- rv = SCARD_F_COMM_ERROR;
- goto end;
- }
- } while (SCARD_E_SHARING_VIOLATION == scReconnectStruct.rv);
+ if (rv == -1)
+ {
+ rv = SCARD_F_COMM_ERROR;
+ goto end;
+ }
*pdwActiveProtocol = scReconnectStruct.dwActiveProtocol;
rv = scReconnectStruct.rv;
More information about the Pcsclite-cvs-commit
mailing list