[Pcsclite-cvs-commit] CVS PCSC/src

CVS User rousseau ludovic.rousseau@free.fr
Sat, 11 Sep 2004 12:31:39 -0600


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

Modified Files:
	eventhandler.c 
Log Message:
EHDestroyEventHandler(): do not try to stop a not started thread (for a
reader that failed initialisation and never started)


--- /cvsroot/pcsclite/PCSC/src/eventhandler.c	2004/09/07 07:02:02	1.28
+++ /cvsroot/pcsclite/PCSC/src/eventhandler.c	2004/09/11 18:31:39	1.29
@@ -9,7 +9,7 @@
  * Copyright (C) 2004
  *  Ludovic Rousseau <ludovic.rousseau@free.fr>
  *
- * $Id: eventhandler.c,v 1.28 2004/09/07 07:02:02 rousseau Exp $
+ * $Id: eventhandler.c,v 1.29 2004/09/11 18:31:39 rousseau Exp $
  */
 
 #include "config.h"
@@ -96,7 +96,13 @@
 
 LONG EHDestroyEventHandler(PREADER_CONTEXT rContext)
 {
-	if (rContext->readerState && rContext->readerState->readerName[0] == '\0')
+	if (NULL == rContext->readerState)
+	{
+		DebugLogA("Thread never started (reader init failed?)");
+		return SCARD_S_SUCCESS;
+	}
+
+	if ('\0' == rContext->readerState->readerName[0])
 	{
 		DebugLogA("Thread already stomped.");
 		return SCARD_S_SUCCESS;