[Pcsclite-cvs-commit] Drivers/ccid/src ifdhandler.c,1.33,1.34

rousseau@haydn.debian.org rousseau@haydn.debian.org


Update of /cvsroot/pcsclite/Drivers/ccid/src
In directory haydn:/tmp/cvs-serv25444

Modified Files:
	ifdhandler.c 
Log Message:
if DEBUG_LEVEL_PERIODIC is not set we temporaily remove DEBUG_LEVEL_COMM in
IFDHICCPresence() to avoid having the low level debug every time pcscd
test the card presence


Index: ifdhandler.c
===================================================================
RCS file: /cvsroot/pcsclite/Drivers/ccid/src/ifdhandler.c,v
retrieving revision 1.33
retrieving revision 1.34
diff -u -d -r1.33 -r1.34
--- ifdhandler.c	30 Jun 2004 13:40:12 -0000	1.33
+++ ifdhandler.c	30 Jun 2004 13:42:23 -0000	1.34
@@ -842,15 +842,27 @@
 
 	unsigned char pcbuffer[SIZE_GET_SLOT_STATUS];
 	RESPONSECODE return_value = IFD_COMMUNICATION_ERROR;
+	int oldLogLevel;
 
 	DEBUG_PERIODIC2("lun: %X", Lun);
 
 	if (CheckLun(Lun))
 		return IFD_COMMUNICATION_ERROR;
 
-	if (CmdGetSlotStatus(Lun, pcbuffer) != IFD_SUCCESS)
+	/* if DEBUG_LEVEL_PERIODIC is not set we remove DEBUG_LEVEL_COMM */
+	oldLogLevel = LogLevel;
+	if (! (LogLevel & DEBUG_LEVEL_PERIODIC))
+		LogLevel &= ~DEBUG_LEVEL_COMM;
+
+	return_value = CmdGetSlotStatus(Lun, pcbuffer);
+
+	/* set back the old LogLevel */
+	LogLevel = oldLogLevel;
+
+	if (return_value != IFD_SUCCESS)
 		return IFD_COMMUNICATION_ERROR;
 
+	return_value = IFD_COMMUNICATION_ERROR;
 	switch (pcbuffer[7])	/* bStatus */
 	{
 		case 0x00: