Blob Blame History Raw
From 4f7c0110cb95e599d164e503910cde930ba3f993 Mon Sep 17 00:00:00 2001
From: rousseau <rousseau@0ce88b0d-b2fd-0310-8134-9614164e65ea>
Date: Mon, 30 May 2011 09:22:57 +0000
Subject: [PATCH] EHStatusHandlerThread(): always sleep if the driver card
 event function returns an error (and not just in the case
 of IFD_NO_SUCH_DEVICE)

This avoids to loop too fast in case of a problem. This happens after
activating a smart card reader in vmware workstation for example.

See https://bugs.launchpad.net/ubuntu/+source/pcsc-lite/+bug/787451
"pcscd spams to syslog and kern.log after enabling smartcard reader in
VMWare Workstation"


git-svn-id: svn://svn.debian.org/pcsclite/trunk@5769 0ce88b0d-b2fd-0310-8134-9614164e65ea
---
 src/eventhandler.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/src/eventhandler.c b/src/eventhandler.c
index 603ad81..e291fab 100644
--- a/src/eventhandler.c
+++ b/src/eventhandler.c
@@ -429,7 +429,7 @@ static void EHStatusHandlerThread(READER_CONTEXT * rContext)
 				timeout = PCSCLITE_STATUS_EVENT_TIMEOUT;
 
 			ret = rContext->pthCardEvent(rContext->slot, timeout);
-			if (IFD_NO_SUCH_DEVICE == ret)
+			if (IFD_SUCCESS != ret)
 				(void)SYS_USleep(PCSCLITE_STATUS_POLL_RATE);
 		}
 		else
-- 
1.7.5.4