scd: acquire lock in new_reader_slot.
authorNIIBE Yutaka <gniibe@fsij.org>
Mon, 18 Jun 2012 06:08:01 +0000 (15:08 +0900)
committerNIIBE Yutaka <gniibe@fsij.org>
Mon, 25 Jun 2012 01:04:23 +0000 (10:04 +0900)
commit4f557cb9c2ebe274d6aacc60a09cd919055d01ed
tree5f2e3b318b34b82e8939ff8d902024e45b80b664
parent233b5ab1ad90588e7a40d2009b9f10d91e3b0c7d
scd: acquire lock in new_reader_slot.

* scd/apdu.c (new_reader_slot): Acquire lock.
  (open_ct_reader, open_pcsc_reader_direct, open_pcsc_reader_wrapped)
  (open_ccid_reader, open_rapdu_reader): Release lock.

--
Fixes a test case of:
   No libpcsclite1 installed.
   Run gpg-agent
   Run command "gpg-connect-agent learn /bye" with no card/token
   Sometimes it fails: ERR 100663356 Not supported <SCD>
   While it should be always: ERR 100663404 Card error <SCD>
scd/apdu.c