summaryrefslogtreecommitdiff
path: root/libcacard
diff options
context:
space:
mode:
authorAlon Levy <alevy@redhat.com>2012-03-22 19:44:49 +0200
committerAlon Levy <alevy@redhat.com>2012-03-26 18:39:00 +0200
commit1b902f7defa9f5229f92dfb32406c5b30c8045ab (patch)
tree9e1bc33899202d874bf26a43e3ce0ff61e1ddb72 /libcacard
parentcb1977d308f6e1d6bf398d42e6148187b82456c1 (diff)
downloadqemu-1b902f7defa9f5229f92dfb32406c5b30c8045ab.tar.gz
libcacard/vcard_emul_nss: don't stop thread when there are no slots
Signed-off-by: Alon Levy <alevy@redhat.com>
Diffstat (limited to 'libcacard')
-rw-r--r--libcacard/vcard_emul_nss.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/libcacard/vcard_emul_nss.c b/libcacard/vcard_emul_nss.c
index bdc3c79462..7de5d5b5a7 100644
--- a/libcacard/vcard_emul_nss.c
+++ b/libcacard/vcard_emul_nss.c
@@ -682,8 +682,19 @@ vcard_emul_event_thread(void *arg)
SECMODModule *module = (SECMODModule *)arg;
do {
+ /*
+ * XXX - the latency value doesn't matter one bit. you only get no
+ * blocking (flags |= CKF_DONT_BLOCK) or PKCS11_WAIT_LATENCY (==500),
+ * hard coded in coolkey. And it isn't coolkey's fault - the timeout
+ * value we pass get's dropped on the floor before C_WaitForSlotEvent
+ * is called.
+ */
slot = SECMOD_WaitForAnyTokenEvent(module, 0, 500);
if (slot == NULL) {
+ /* this could be just a no event indication */
+ if (PORT_GetError() == SEC_ERROR_NO_EVENT) {
+ continue;
+ }
break;
}
vreader = vcard_emul_find_vreader_from_slot(slot);