]> Git Repo - qemu.git/commitdiff
libcacard/vcard_emul_nss: don't stop thread when there are no slots
authorAlon Levy <[email protected]>
Thu, 22 Mar 2012 17:44:49 +0000 (19:44 +0200)
committerAlon Levy <[email protected]>
Mon, 26 Mar 2012 16:39:00 +0000 (18:39 +0200)
Signed-off-by: Alon Levy <[email protected]>
libcacard/vcard_emul_nss.c

index bdc3c79462c65d73c684d9a2694533cfcd90be34..7de5d5b5a7ab5606a4a476a4be3039e7aa0b1eb5 100644 (file)
@@ -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);
This page took 0.028773 seconds and 4 git commands to generate.