scd: PC/SC status fix.
authorNIIBE Yutaka <gniibe@fsij.org>
Tue, 26 Mar 2013 03:43:24 +0000 (12:43 +0900)
committerNIIBE Yutaka <gniibe@fsij.org>
Tue, 26 Mar 2013 03:49:03 +0000 (12:49 +0900)
* scd/apdu.c (pcsc_get_status_direct): Check PCSC_STATE_MUTE only when
PCSC_STATE_PRESENT.

* scd/pcsc-wrapper.c (handle_status): Ditto.

scd/apdu.c
scd/pcsc-wrapper.c

index 87c0426..92c9864 100644 (file)
@@ -891,9 +891,11 @@ pcsc_get_status_direct (int slot, unsigned int *status)
 
   *status = 0;
   if ( (rdrstates[0].event_state & PCSC_STATE_PRESENT) )
-    *status |= APDU_CARD_PRESENT;
-  if ( !(rdrstates[0].event_state & PCSC_STATE_MUTE) )
-    *status |= APDU_CARD_ACTIVE;
+    {
+      *status |= APDU_CARD_PRESENT;
+      if ( !(rdrstates[0].event_state & PCSC_STATE_MUTE) )
+       *status |= APDU_CARD_ACTIVE;
+    }
 #ifndef HAVE_W32_SYSTEM
   /* We indicate a useful card if it is not in use by another
      application.  This is because we only use exclusive access
index a135d1e..86e4afb 100644 (file)
@@ -602,9 +602,11 @@ handle_status (unsigned char *argbuf, size_t arglen)
   if ( !(rdrstates[0].event_state & PCSC_STATE_UNKNOWN) )
     {
       if ( (rdrstates[0].event_state & PCSC_STATE_PRESENT) )
-        status |= 2;
-      if ( !(rdrstates[0].event_state & PCSC_STATE_MUTE) )
-        status |= 4;
+       {
+         status |= 2;
+         if ( !(rdrstates[0].event_state & PCSC_STATE_MUTE) )
+           status |= 4;
+       }
       /* We indicate a useful card if it is not in use by another
          application.  This is because we only use exclusive access
          mode.  */