[Pcsclite-cvs-commit] CVS PCSC/src

CVS User rousseau ludovic.rousseau@free.fr
Thu, 02 Dec 2004 12:08:48 -0700


Update of /cvsroot/pcsclite/PCSC/src
In directory haydn:/tmp/cvs-serv30657

Modified Files:
	winscard_clnt.c 
Log Message:
SCardGetStatusChange(): move timeout check after other checks so we do
not exit with timeout if the timeout is less than 200 ms
(PCSCLITE_STATUS_WAIT)


--- /cvsroot/pcsclite/PCSC/src/winscard_clnt.c	2004/12/02 18:52:14	1.47
+++ /cvsroot/pcsclite/PCSC/src/winscard_clnt.c	2004/12/02 19:08:47	1.48
@@ -9,7 +9,7 @@
  *  Damien Sauveron <damien.sauveron@labri.fr>
  *  Ludovic Rousseau <ludovic.rousseau@free.fr>
  *
- * $Id: winscard_clnt.c,v 1.47 2004/12/02 18:52:14 rousseau Exp $
+ * $Id: winscard_clnt.c,v 1.48 2004/12/02 19:08:47 rousseau Exp $
  */
 
 #include "config.h"
@@ -1407,21 +1407,6 @@
 		if (j == cReaders)
 			j = 0;
 
-		if (dwTimeout != INFINITE && dwTimeout != 0)
-		{
-			/*
-			 * If time is greater than timeout and all readers have been
-			 * checked
-			 */
-			if ((dwTime >= (dwTimeout * 1000)) && (j == 0))
-			{
-				SYS_MutexUnLock(psContextMap[dwContextIndex].mMutex);	
-				return SCARD_E_TIMEOUT;
-			}
-
-			dwTime += PCSCLITE_STATUS_WAIT;
-		}
-
 		/*
 		 * Declare all the break conditions
 		 */
@@ -1442,6 +1427,20 @@
 		if ((dwTimeout == 0) && (j == 0))
 			break;
 
+		if (dwTimeout != INFINITE && dwTimeout != 0)
+		{
+			/*
+			 * If time is greater than timeout and all readers have been
+			 * checked
+			 */
+			if ((dwTime >= (dwTimeout * 1000)) && (j == 0))
+			{
+				SYS_MutexUnLock(psContextMap[dwContextIndex].mMutex);	
+				return SCARD_E_TIMEOUT;
+			}
+
+			dwTime += PCSCLITE_STATUS_WAIT;
+		}
 	}
 	while (1);