Sleep before trying to poll again in case of an error (#718375)

This commit is contained in:
Kalev Lember 2011-07-02 16:52:50 +03:00
parent 2803499a70
commit 50b6078550
2 changed files with 43 additions and 1 deletions

View File

@ -0,0 +1,36 @@
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

View File

@ -2,7 +2,7 @@
Name: pcsc-lite
Version: 1.7.2
Release: 2%{?dist}
Release: 3%{?dist}
Summary: PC/SC Lite smart card framework and applications
Group: System Environment/Daemons
@ -19,6 +19,8 @@ Patch3: %{name}-1.6.6-no_auto_power_down
# Avoid filling log files with "rv=0x... for client" and "Card Not Inserted"
# messages (#657658, #707412)
Patch4: pcsc-lite-1.7.2-loglevel.patch
# Sleep before trying to poll again in case of an error (#718375)
Patch5: pcsc-lite-1.7.2-pollrate.patch
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
BuildRequires: libudev-devel
@ -72,6 +74,7 @@ Requires: %{name}-libs = %{version}-%{release}
%patch1 -p1 -b .rpath64
%patch2 -p1 -b .noautostart
%patch4 -p1 -b .loglevel
%patch5 -p1 -b .pollrate
# Convert to utf-8
for file in ChangeLog; do
@ -154,6 +157,9 @@ fi
%changelog
* Sat Jul 02 2011 Kalev Lember <kalev@smartlink.ee> - 1.7.2-3
- Sleep before trying to poll again in case of an error (#718375)
* Wed May 25 2011 Kalev Lember <kalev@smartlink.ee> - 1.7.2-2
- Don't fill log files with repeating messages (#657658, #707412)